objective c - Adding a detail text labels to an existing array of strings, UITableView -


i have array in uitableviewcontroller.m

    self.movies = [nsarray arraywithobjects:                @"zardoz",                @"dark city",                @"inland empire",                @"gangs of new york",                @"enemy",                @"they live",                @"lost highway",                nil]; 

i initwithstyle:uitableviewcellstylevalue2. trying add detailtextlabel each corresponding each movies idbm rating(double). create array values? thanks.

easiest thing create new class, literally like:

@interface movieobject  @property (copy) nsstring *name; @property (copy) nsstring *moviedescription;  @end 

and can add objects of type mutable array of movies:

newmovie = [[movieobject alloc] init]; newmovie.title = @"zardoz" newmovie.moviedescription = @"oscar winner" [self.movies addobject: newmovie]; 

and when fetch objects, you'll have both title , detail text go movie title.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -