objective-c

What are @property and @synthesize used for in Objective-C?

What is the use of @property and @synthesize? Can you explain with an example please? ...

The's the meaning of "forces the linker to load all object files from every archive it sees" for Objective-C linker flag OTHER_LD_FLAGS=-all_load?

I read this Q&A: http://stackoverflow.com/questions/2906147/what-does-the-all-load-linker-flag-does So, does this affect runtime loading? Does final program load unnecessary symbols or only for link time? ...

Cocoa/Objective C: Convert numbers to strings using Japanese unicode characters

Converting numbers to strings is no problem, but the string created uses ascii numbers. I am inserting the number in a Japanese sentence. The character itself is correct, say 3, for example, but the width and positioning should be a little different when typing in Japanese. As a result the number looks cramped up against the following ch...

epub2pdf paginate the html format

I am working on a project which needs to convert epub to pdf. I am stuck on how to paginate the html format. Can someone give me some idea? is there any open source libs to paginate the html like the print review in most browser? ...

NSMutableArray replace content?

I have a custom object and NSMutableArray as instance member. I fill the array with some data after creation. I need a method to replace the content of the array. I tried: -(void)replaceArr:(MyClass*) obj { [mList removeAllObjects]; NSMutableArray * tempArr=[obj mList]; mList=[NSMutableArray initWithArray:tempArr]; } But it is fail...

How to extract the data I want in NSString?

I have a NSString like this: 456673\tSomething But I would like to extract Something only.... ... All the data must be in this format .... xxxx\tyyyy How can I split it bases on \t? thank you. ...

How do you write program for Mac OS X?

Hi just wondering how do you start writing programs for MAC OS X? what language does it use? can I use objective C? which IDE do I use? any licensing fee should I know about. Thanks. ...

String Conversion in Objective-C

In my program, I'm allowing the user to input some words into a textfield. Then my program will use these words to form a html string. The string will then be used in NSURL so I can connect to the website. This method works great for english words. But when I input some chinese (or korean) in there, I does not work. Thus I believe that...

The Why and the How of Creating a Watchdog in Cocoa/Objective-C

Happy Monday to you all! Here is my situation. Any assistance greatly appreciated! I have created an executable that when installed gets placed in the Launch Agents folder of the machine. In theory it should run perpetually, collecting data every second. It can stop when the machine is asleep, but restart when the computer is reactivat...

How to compare an id to a value in Iphone

Hi please see the code below -(void) dataFromURL:(NSString *)url withRef:(id)ref { if(ref==@"Category") Printf("category"); //I need control here but control does't come here. else printf("Subcategory"); } How i will compare id datatype(ref) to a value like-Category. when i print ref through NSLog(@"ID %@",ref); It returns as C...

set first text on UISearchBar

i want to set first text on my UISearchBar -the text is "Search"-, and the text will disappear when user start typing. just like this: how it could be.??? thanx ...

Access UIView after adding it to superview/as a subview

Hi, I have a variable sized array of UIImageViews that I'd like to add to my main View. So I loop through the array, adding each UIImageView to the scene as follows: for (UIImageView *nextImageView in myImageArray] [self.view addSubview:nextImageView]; (I also configure their frames individually but have left that out here) Howev...

Dropdown list view in iPhone

Hi All, Has any one has the implemented drop-down view in their application. The drop-down view should behave like a search suggestion drop-down or a normal drop-down web component view having a button with the text-view field. Or can any one guide me to such an article of the implementation is present on the web. I have tried goggling...

My object seems to get deleted, with me requesting that. EXEC_BAD_ACCESS

I create an array of custom objects called players. @interface Player : NSObject { NSString *name; NSNumber *spd; NSNumber *atk; NSNumber *def; } @property(nonatomic, retain) NSString *name; @property(nonatomic, retain) NSNumber *spd; @property(nonatomic, retain) NSNumber *atk; @property(nonatomic, retain) NSNumber *de...

getting the next and previous track if using iPodMusicPlayer

Hi, Im using an iPodMusicPlayer for my MPMusicController. My question is once my appplication is launched and will continue what the iPod app is playing, can i retrieve the MPMediaItem of the next and previous track of the iPod music app? I cant seem to find a way to know if user chose albums, artists or songs as his/her choice on th...

Load tabbars dynamically from a plist file

Hi, I have a plist file with a dictionary of several names of tabbars (e.g. tabbar1, tabbar2, tabbar3). I want to loop over this dictionary and load the tabbars when the app starts. My problem is that the .h file does not contain the according objects (e.g. TabbarViewController1). So, is it possible to load tabbars/viewcontrollers at ...

Customising UITabBarItems in their controllers?

In previous applications I have customised my tabBarItems by overriding init (see below) - (id)init { self = [super init]; if(self) { UITabBarItem *tabBarItem = [self tabBarItem]; [tabBarItem setTitle:@"ONE"]; } return self; } After looking at the Xcode templates I am now thinking that I would be better...

UIWebView: open some links in Safari, some within the view

My app features content that (for text formatting reasons) is presented in an UIWebView. Within the content there are links, some of which should open their target in mobile Safari, while others should navigate within the content. So far, I've catched the link requests using a UIWebView delegate. In my implementation of -(BOOL)webView:...

How to convert objective C array to a C array?

I have NSArray in Objective C, which store int only. How can I convert it to C array? Thanks. My Objective C array: NSArray *myArray = [[NSArray alloc] initWithObject:@"1", @"4", @"8", nil]; ...

How to print exception stack trace of Objective-C exceptions with GNU runtime and without GNUStep?

I have an Objective-C app build on Linux with GCC 4.3 using no specific framework (only GNU-runtime). I am using Objective-C exceptions (via the '-fobjc-exceptions' compiler flag). Now I want to print the stack trace of such an exception when I caught some. Or what would make me even happier: put the trace in a string or some kind of st...