I have a Book data entity that has as an attribute an int 16 type value called numBooks. Due to the way everything is setup, I am actually grabbing the number I need inside titleForRow, and saving the value to a global variable of type NSNumber.
In titleForRow, I am setting the global in this way:
global = book.numBooks;
If I NSLog my global variable after it is set thus, it returns to the consol the proper number value (50 depending). But, if I were to just print book.numBooks to the console, the value is quite different, 100499556.
Now, the problem is that when I take my global variable back to numberOfRowsInComponent, to use as the count of rows for a given component, there is seemingly no end to the number. I can scroll and scroll and it obviously isnt working right.
Does the uiPickerView numberOfRowsInComponent only want an int? Is it basically thinking that the value I am passing it is that 100499556?
Please help, thanks!
Try
You are probably seeing a pointer value for the NSNumber* book.numBooks.