Get position in class hierarchy
Is the a way to get the number of ancestors for an instance of class? E.g. a class of type UITouch would be of level 2 as it inherits from NSObject. ...
Is the a way to get the number of ancestors for an instance of class? E.g. a class of type UITouch would be of level 2 as it inherits from NSObject. ...
Is the objectAtIndex start with 1 instead of 0? I use the objectAtIndex , and passing data 0, but it said that this is out of bound. So, I guess that is start at 1, am I right? ...
I'm trying to return a double from another object then store that into a new double but i'm getting the error incompatible types in initialization. What am I missing here? double gradePoints = 0.0; double other = [aCourse getGradePoints]; gradePoints = gradePoints + other; This is in my other object - (double) getGradePoints{ retu...
Hello. When I build and analyze my project on XCode, I obtain a 'warning' on the following line: NSString *contactEmail = (NSString *)ABMultiValueCopyValueAtIndex(emailInfo, 0); The message is: Potential leak on object allocated on line ... and stored into contactEmail. Is there any error on that line? UPDATE I get the same 'warni...
Hello everybody, Today my question is about UITableViewController-s In particular I have noticed that the datasource delegate method - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView; is called twice (even if for instance I just create a navigation based application and without adding a line of code.. well adding an N...
According to the (in)famous iPhone Developer Program License Agreement change 3.3.1 — Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine...
Hi, I have an UIViewController into an navigationController.All I want is when I rotate from landscape into portrait, to change the view into another one which belong to another view controller(another tab from the bottom tab bar controller). I have done this using the following code: -(void) willRotateToInterfaceOrientation:(UIInterf...
I'm loading 5 images from disk but I want the 1st image I read to show as soon as possible. Right now I do UIImage *img = [UIImage imageWithContentsOfFile:path]; in a for loop but since imageWithContentsOfFile:path isn't blocking all 5 images wind up getting read from disk before the first one will appear (because they're all using u...
I am working on a simple app tab-bar based application that has two views. The first is the main application and the second is a simple instruction screen. What I am trying to do is update a label on that second screen as things change in the main app. Because the second screen is only simple with one label and some text I am not unloadi...
Hello. I have the following code: @implementation SendMapViewController NSMutableArray *emails; At this method I create emails array and I add some NSStrings: - (BOOL) peoplePickerNavigationController: (ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson: (ABRecordRef)person { ABMultiVal...
Hi, I have a UILabel tha contains a URL (ie www.google.com). Is there a way to display the label as URL so the User can tap on the URL for Safari to open it? Same question I have for a mailto item (ie [email protected]) to open mail with a new email to that address thanks in advance ...
My application has a view controller that extends UITableViewController. The initialization method looks like this: - (id)initWithCoder:(NSCoder*)coder { if (self = [super initWithCoder:coder]) { self.tableView = [[UITableView alloc] initWithFrame:self.tableView.frame st...
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { MaSystemGuiAppDelegate *appDelegate = (MaSystemGuiAppDelegate *)[[UIApplication sharedApplication] delegate]; appDelegate.deneme = [tableData objectAtIndex:indexPath.row] ; NSLog(@"my row", appDelegate.deneme); // THIS IS NOT PRINTING*...
I am creating an exercise app that will record the weight used and the number of "reps" the user did in 4 "Sets" per day over a period of 7 days so the user may view their progress. I have built the database table named FIELDS with 2 columns ROW and FIELD_DATA and I can use the code below to load the data into the db. But the code has ...
What is the best way to create a custom UIView that I can consume in Interface Builder? Create a custom UIView in Interface Builder and inherit from UIView in a code file, then somehow use it in another UIView ala like a control. (How do I do this?) Create a custom UIView in Interface Builder and have a custom UIViewController wire it ...
Hi, I've read apple's Objective-C doc and am curious about using @synthesize. I've seen classes with a long list of @synthesizes and I've seen classes with one @synthesize then a long comma-separated list of ivars. So what's the difference between: @synthesize ivar1; @synthesize ivar2; @synthesize ivar3; and @synthesize ivar1, iva...
Hi,everybody I`m trying to run a window as modal directly from the code. My program starts and a main NSWindows is showed.A thread still running to see if the user has a valid distribution. if he doesn't I need to run a modal.I mean, I have no buttons clicked in the interface.I've designed a NSWindow on the interface builder for a passw...
Is there a way to fetch the current reference count for an NSObject (i.e. NSString)? ...
Hello, I've been trying to implement a simple component-based game object architecture using Objective-C, much along the lines of the article 'Evolve Your Hierarchy' by Mick West. To this end, I've successfully used a some ideas as outlined in the article 'Objective-C Message Forwarding' by Mike Ash, that is to say using the -(id)forwar...
Example: I have an NSArray with 40 objects. What is the most efficient way to return ONLY those objects with index equal to a number specified in another NSArray (e.g {0, 27, 36} for example)? Can a predicate be used here? Or is there a more simple and efficient approach? ...