Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hcri50

macrumors newbie
Original poster
Dec 18, 2007
17
0
my .h file
Code:
@property (nonatomic,strong) NSString *University;

@property (nonatomic,strong) NSString *FirstName;

@property NSNumber *VC_1;

@end
my .m file
Code:
-(void)Down_Load_Data
{


NSString *urlString = [NSString stringWithFormat:@"http://127.0.0.1/DownLoadDataModule_1.php"];

NSURL *url =[NSURL URLWithString:urlString];

NSData *data = [NSData dataWithContentsOfURL:url];

NSError *error;


NSMutableDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];

NSLog(@"%@",json);


NSArray *jsonArry = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];

for (NSDictionary *dict in jsonArry) {

// How do I get the Values from my DataBase into my Properties ????
// I am at a total lost, I see my values in the NSLog with no problem, but I have no ideal on how to UpDate my Properties Values
// RIGHT BELOW 

NSLog(@"%@,%@,%@", [dict objectForKey:@"University"],[dict objectForKey:@"FirstName"],[dict objectForKey:@"VC_1"]);

if ([University isEqualToString: @"UCDMedical"])

{
NSLog(@"First Name %@",FirstName);

NSLog(@"VC_1 %@",VC_1);
}
}
}
:confused:
 
Last edited by a moderator:

hcri50

macrumors newbie
Original poster
Dec 18, 2007
17
0
Problem Solved

Just solved my problem all I had to do. I keep forgetting to put self. for my properties.
I spent 2 days on this, I do believe that it has finally burnt in my memory.

.self

self.University = [dict objectForKey:mad:"University"],self.FirstName = [dict objectForKey:mad:"FirstName"],self.VC_1 = [dict objectForKey:mad:"VC_1"];
 

Duncan C

macrumors 6502a
Jan 21, 2008
853
0
Northern Virginia
Just solved my problem all I had to do. I keep forgetting to put self. for my properties.
I spent 2 days on this, I do believe that it has finally burnt in my memory.

.self

self.University = [dict objectForKey:mad:"University"],self.FirstName = [dict objectForKey:mad:"FirstName"],self.VC_1 = [dict objectForKey:mad:"VC_1"];

So mark the thread as resolved:

https://forums.macrumors.com/threads/1093283/
 

MattInOz

macrumors 68030
Jan 19, 2006
2,760
0
Sydney
Two things that might be helpful to you.
1) help us help you. Ask a question not just an emoticon. Yes post code but if you don't ask a question we have no idea what is causing :confused:.

2)Use autocomplete - with autocomplete on you shouldn't need to type more than 3-4 characters before the sort of result you want will be in the list. If it's not there it is a big sign your missing something.

I'm sure there are other hints. :D
 

hcri50

macrumors newbie
Original poster
Dec 18, 2007
17
0
Thank you very much

I will ensure that I will follow your advice for future posts.
THANK you
robert
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.