objective-c

Breaking circular references while maintaining access to attributes (Objective-c)

I have two classes (Test1 and Test2) that each have a property (test2 and test1 respectively) pointing to an instance of the other class. This means that Test1.m must import Test2.h and Test2.m must import Test1.h. The .h files must also have a forward declaration. Unfortunately, this means that I cannot access the attributes of test2 an...

The application cannot be opened because its executable is missing.

I have an application that I have been developing for some time now. Recently launching the application via a double click presents a dialog that says "You can't open the application RepoWatch because it may be damaged or incomplete." Launching the application via open ./RepoWatch.app gives me "The application cannot be opened because i...

Getting URL From beginSheetModalForWindow:

I'm using an OpenPanel to get a file path URL. This works: [oPanel beginSheetModalForWindow:theWindow completionHandler:^(NSInteger returnCode) { NSURL *pathToFile = nil; if (returnCode == NSOKButton) pathToFile = [[oPanel URLs] objectAtIndex:0]; }]; This doesn't, resulting in an 'assignment of read-only variable' error: NSUR...

Make a Custom Class Serializable in Objective-c/iPhone?

How can I make my own custom class serializable? I specifically want to write it to a file on iPhone, just plist and thee class is just a simple instance class, just NSStrings and maybe a NSUrl. ...

How to access @public instance variable from another class in Objective-C?

I know it's possible to define public instance variable with @public keyword. However, Objective-C syntax does not allow accessing other class' variable. What features should I expected from @public Ivar? Or how do I access other class' Ivars? ...

How to Show a GPL licence in iphone application bundle.

Hi friends i am making an app for iphone and for that i am using certain free libraries.My problem is that i want to show their complete license of nearly 4-5 pages in my application bundle so that a user can open settings in iphone and see that licensing page at one time but i am unable to do it.I have read these Specifiers for making...

iPhone + access Controls from other class

I have classes: PropertyCalcViewController .m & .h In the .h I have IBOutlet UIButton *btnGo; @property (nonatomic, retain) IBOutlet UIButton *btnGo; and in the .m file I have @synthesize *btnGo; Now I also have another class Manager .m & .h. What I want to do is that access btnGo from the Manager class and remove it from Proper...

UIButton - should we release or not?

Ok. Let me explain the situation. I want to add a button on a view dynamically. Here is the code. UIButton *x=[UIButton buttonWithType:UIButtonTypeRoundedRect]; Here, I have not used "alloc" function. The questions for this statements are as follow. If we are using imageview for the same situation, we have to create an temp imagev...

NSString basics - memory - retain - copy

Here is my question. NSString *xyz=[NSString stringWithFormat:@"%i %@",10,@"Sagar"]; Now I am taking other string, as follows. NSString *x2=[xyz copy]; I exactly don't know what will happen here? ( Is it something like, x2 has the ref of xyz's ref. ) NSString *x3=[xyz retain]; ( What will happen here, x3 has a new memory having...

Categories vs Informal Protocols

Hi there, I think I understood the difference between (formal) Protocols and Categories. Now, if I got it right, informal protocols should be categories (usually defined on NSObject) which are used for certain purposes (maybe to give the chance to implement only a part of the methods listed in it, unlike formal protocols). I need to be ...

Objective-C: Best way to store error messages

What's the best way to store error messages (specially while developing with Xcode and Objective-C for Mac and iPhone): Creating a separate class that contains list of error code and corresponding messages .plist of error code and corresponding messages Localizable.string file with error code and corresponding messages (the applicati...

How can I check missed call in iPhone using Objective-C?

How can I check missed call in iPhone using Objective-C? ...

Creating a error-handling UIView Overlay

I have a Tab Bar controller inside a Navigation controller. I want to create a view, with a single 320x411 image (leaving the status bar, and the tab bar). The image is shown for a network connection error. Currently I'm using this code, in the tab bar item's individual view's viewDidLoad: if (appDelegate.hasInternetAtStart == NO) { ...

How do I save an NSString as a .txt file on my apps local documents directory?

How do I save an NSString as a .txt file on my apps local documents directory (UTF-8)? ...

How to insert data to sqlite database in iphone

I am new to iphone development.I want to insert certain data into my database and retrieve it and display it in a table.I have created Database data.sqlite with table 'user' .The table has two values id(varchar) and name(varchar).I have inserted 3 rows of data in table via "insert into user value('1','xxxx');" in terminal window.I have...

How to declare local "variables" as final in Objective-C?

In Java, I can declare local "variables" as final, e.g. void myMethod() { final String foo = "Hello World!"; foo = "Bye-bye..."; // compile error!! return; } When I try to change its value, a get an error from the compiler. I want to declare some of my local "variables" final to avoid changing their value by accident. Is ...

Objective C in C++ – Out of Scope

Hello, I have a little problem with the WOsclib. Not particularly with the library, it's more the callback function. The listen to specific osc commands i have to put up some callback method like void TheOscStartMethod::Method( const WOscMessage *message, const WOscTimeTag& when, ...

Animating a font size change in a UITableView

Hey Simple little app for educational purposes, its a simple uitableview and I want users to be able to use a uislider to adjust the font size as needed. The code I have now works to change the font but only when the view is updated, ie when i pull up or down the table view to reveal other cells. I'd like the font change to be reflected ...

NSZombieEnabled causes app to run out of memory before the EXC_BAD_ACCESS I'm trying to diagnose occurs

I'm working on a 2d OpenGL ES game. I've used Clang and Instruments to find and eliminate all leaks. My app's memory usage (Live Bytes in ObjectAlloc) holds steady at around 1.5MB. However, long play sessions result in an eventual EXC_BAD_ACCESS. When I turn on NSZombieEnabled the app runs out of memory (and crashes) before the EXC_BAD_A...

dispatch events to parent views

Hello. I have a ViewController which has a button that when is pressed adds a subview from nib. I have this action: - (IBAction) addTooltip { if (self.tooltip == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"Tooltip" owner:self options:nil]; self.tooltip = [nib objectAtIndex:0]; self.tooltip.fra...