objective c - Files and their initialization -
a quick question hope. i'm new xcode , ios apps, , have made bunch of tutorials still don't 1 thing. if make new file (staticdata.h, staticdata.m) , in .h declare public property nsmutablearray
. , in .m file fill statically.
@implementation staticdata -(nsmutablearray *)staticarray { nsstring *value0 = @"test)"; return [nsmutablearray arraywithobjects:value0, nil]; } @end
now import .h file in viewcontroller , try load data in table. array empty. set breakpoint never hit.
so how init file without view?
you need use file creating instance of class staticdata this:
staticdata *data = [[staticdata alloc] init];
don't forget delete data
when ready!
Comments
Post a Comment