I have this RootViewController creation method, i want receive int value but i don’t know how.
+ (RootViewController2*) loadNames:(NSArray*)names sec:(int)sec
{
RootViewController2 * cont2 = [[RootViewController2 alloc] initWithNibName:@"RootViewController2" bundle:nil];
[cont2 set???????:[NSNumber numberWithInt:sec]];
[cont2 setSubsecciones:names];
return [cont2 autorelease];
}
Why can’t you add a
secint assign property and use[cont2 setSec:sec]?Example:
In you
RootViewController2class interface add:In your
RootViewController2class implementation add:And then in
loadNamesuse:Or if you don’t like the property dot-notation: