objective-c

How to determine if NSString is empty

What is the best was to determine if an NSString is empty? Right now I am using the following: if (string == nil || [string isEqualToString:@""]) { // do something } Thanks for any advice. ...

iTunes Apple Events API

I'd like to control iTunes through Objective-C ( I just can't get Python appscript installed correctly on my OS/X 10.6.3 system ... that would have been my first choice ). From what I gather, the IPC on Cocoa is based on Apple Events : is there either: Online documentation on iTunes / Apple Events API ? Instrospection mechanism to get...

For the iPhone, can you program for different languages?

For the iPhone, is it possible to program applications to translate words from a base language to any of several languages of various users. If so, how? ...

Int arrays in Objective-C

So I have this: int a[4] = { 0, 1, 2, 3 }; And then I want to make a new int array: int b[4]; What is the easiest way to make b[] = a[]? ...

Problem of Loading Xib with Tab bar Controller

Hello, I am using two xib one without tab bar and another with tab bar controller. In starting i load the xib without tab bar-navigation bar then flow are working.But if i load a xib with tab bar Controller -navigation bar then our all view slide bellow and half tab bar are not showing. So Please give some code how to use tab bar cont...

How can I get the title of the selected UISegment in a UISegmentControl?

The class of the selected segment is shown as UISegment, which I can't find a class reference to. Surely there is a way to access the title associated with the selected index? ...

How do I launch the Mac Address Book from my app and select a specific person?

I have an app and I am reading in the address book information using the ABAddressBook APIs and selecting a person. I would like to provide a link from my app to launch the Mac address book and pre-select a specific user. I'm sure there are several ways to do it - I came up with one that seems to work but it feels a little clunky. I l...

Are Objective-C function names stored in text?

I don't remember where I heard about it, (I think I was searching up on how selectors worked and it ended up not being exactly the same as a callback function) and I can't confirm it. But more importantly than that, is there a way I could get a list of the function names from another application? ...

How can I fix this NavigationController and UIToolbar offset issue in Objective-C?

I'm adding a couple of buttons to an already-existing NavigationController. The two buttons are added to a UIView, which is pushed onto the NavigationItem. The buttons stop and reload a UIWebView. Problem is that there's a slight offset issue that is making it all look pretty ugly. I wish I could set the UIToolbar to transparent or c...

using crypto++ on iphone sdk with pycrypto on app engine

Hi, I'm trying to encrypt http requests using crypto++ and decrypt them with pycrypto on the app engine server end. Using Arc4 encryption, I can successfully encrypt and decrypt on the iphone end but when I try decrypting on app engine, the result is garbled. The ciphertext after encrypting on the client is the same as the text receive...

Storing acceleration values in Objective-C/Cocoa?

Hi all, I'm writing for the iPhone and I'm trying to measure the time between maximum accelerations. Imagine you've attached your iPhone to an oscillating spring. What I want to do is measure the frequency of the oscillation. The way I am going about doing this is storing a certain number acceleration values (updated 20 times per sec...

sqlite3 DELETE problem "Library Routine Called Out Of Sequence"

Here is my second stupid Noob problem. I am trying to do a simple Delete and I keep blowing up on the prepare step. I already have other Deletes, Inserts, Updates and Selects working. I am sure it is something simple. I appreciate your help. + (void)flushTodaysWorkouts { sqlite3_stmt *statement = nil; //open the database ...

Lua-Objective-C bridge on the iphone

I have partially ported the LuaObjCBridge to the iPhone. Most things work but there are still some issues I have to deal with. There are sections where #defines are defined with-respect-to intel or ppc. Is the ARM chip closer to intel or ppc? Here is the most relevant section where most of the defines are: #if defined(__ppc__)||define...

how to display HTML in a UITextView

essetially I just want formatted HTML rendered in the UITextView, should I be using the undocumented setContentToHTMLString? I feel that I should not be using that, I have tried it, but the text (after being rendered as HTML) does not scroll properly, which is why I suspect its not documented... Should I just use a UIWebView? Can I just...

UITableViewCellSeparatorStyleNone does not hide blue separator line when selecting in UITableView

Before describing the problem, let me first point out that this is a distinct issue from this question. The Problem This screenshot was taken with a break set at tableView:didSelectRowAtIndexPath:, and as you can see in the simulator (far right of the image), there's a single-pixel blue line at the bottom of the selected cell. This is ...

How do you add gestures to a UITableViewController?

I want to implement right-to-left and left-to-right gestures on a view that inherits from UITableViewController. I have the code for the gestures implemented in another view (UIViewController) and it works. It does't seem like touchesBegan is even getting called. Does anyone know know to do this? Thanks ...

sending action to previosu view when using dismissModalViewController iphone

Hello - I am using presentModalViewController to display a view which allows the user to modify data that is being displayed in the first view. After the user has updated the data, I would like to send [tableView reloadData] to the first view. Is that possible? Or is there a method I can create in the first view that gets called when ...

Assigning a view controller to be the delegate of a subview which is not directly descendent?

I am writing an iphone app where in numerous cases a subview needs to talk to its superview. For example: View A has a table view that contains photos A has a subview B which allows users to add photos, upon which I want to auto append them to A's table view So far I have been creating a @protocol in B, and registering A as the deleg...

how to use back button in Xib view which is loaded with tab bar controller

Hello I have two Xib view, one which contain play list and another which play the song containing with tab bar controller. Now after the song was played when we go back to play the next song then it contain the previous view along with navigation bar. I have also tried the method "viewController=nil;".But I have get any result Thanks ...

NSString Library... Anyone know of a helper library for NSString?

Coming from a ruby background, I'm wishing NSString had some convenient methods like the following: [@"John" contains:@"ohn"] => BOOL [@"1,2,3,4," split:@","] => NSArray Anyone know of such an NSString helper library? ...