How to parse an xcode url and get data that returns i.e
1
bilal
engineer
to different xcode fields i.e
NSString *id=1
NSString *name=bilal
NSString *designation=engineer
note. my url is self constructed to simply return the fields
How to parse an xcode url and get data that returns i.e
1
bilal
engineer
to different xcode fields i.e
NSString *id=1
NSString *name=bilal
NSString *designation=engineer
note. my url is self constructed to simply return the fields
I don't know if you are already establishing a connection to your web service or not… if not look up NSURLConnection in Google or Stack Overflow.
Regarding the only part of your question that I understood:
NSString* result = @"1\nbilal\nengineer";
NSArray* components = [result componentsSeparatedByString:@"\n"];
NSString* id = [components objectAtIndex:0];
NSString* name = [components objectAtIndex:1];
NSString* designation = [components objectAtIndex:2];
id is a type, but according to this page it's also a reserved word. That makes sense because id has some special behavior. It's a built-in type that can be used in place of any object pointer type, and when you use it you're basically saying "I don't care about the type."