core data - I want to extend the CoreDataBooks example with a UIPickerView -


i trying add in third method editting view controller in example; simple pickerview field. currently, pickerview has 6 items load it. when run it, shows '?' value on picker view rather word. select right item/row , return calling controller, won't display text.

i believe not allocating array pickerview compiles following warning:

"incompatible objective-c types assigning 'struct narrary *', expected 'struct uipickerview *'" 

here have declared in .h file:

 uipickerview *pickerview;  nsarray *choicearray;    @property (nonatomic, retain) iboutlet uipickerview *pickerview;  @property (nonatomic, retain) nsarray *choicearray; 

and in .m file:

  choicearray = [[nsarray alloc] initwithobjects:@"financial",@"one",@"two",@"three",@"four",@"six", nil];   pickerview = choicearray; //<-- error   [choicearray release]; 

it's line: "pickerview = choicearray;" warning on.

thx, wes

you assigning array pickerview attribute itself. doing this:

(uipickerview*)pickerview = (nsarray*)choicearray; 

you assign rows of picker view delegate object implements uipickerviewdelegate protocol.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -