Resolved I am new to iOS and just need a bit of help please

Discussion in 'iOS Programming' started by hcri50, Nov 8, 2013.

  1. hcri50, Nov 8, 2013
    Last edited by a moderator: Nov 10, 2013

    hcri50 macrumors newbie

    Joined:
    Dec 18, 2007
    #1
    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:
     
  2. hcri50 thread starter macrumors newbie

    Joined:
    Dec 18, 2007
    #2
    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"];
     
  3. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #3
    So mark the thread as resolved:

    http://forums.macrumors.com/showthread.php?t=1093283
     
  4. MattInOz macrumors 68030

    MattInOz

    Joined:
    Jan 19, 2006
    Location:
    Sydney
    #4
    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
     
  5. hcri50 thread starter macrumors newbie

    Joined:
    Dec 18, 2007
    #5
    Thank you very much

    I will ensure that I will follow your advice for future posts.
    THANK you
    robert
     
  6. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #6
    Great, but please mark THIS post as resolved, as described in the link in my previous post.
     
  7. TouchMint.com macrumors 68000

    TouchMint.com

    Joined:
    May 25, 2012
    Location:
    Phoenix
    #7
    If forgotten the self. Before and spent hours trying to figure out what's up haha.
     

Share This Page