objective-c

Project without an .xcodeproj directory, how to open?

I'm finding a few open source projects, mostly older, that lack an .xcodeproj directory hierarchy. It seems like all other crucial files are there. Curiously enough, I'm wondering how these projects are even accessed via Xcode? I'd like to compile them, break them, fix them etc. Is there a way to open these more legacy projects? Here'...

Reading a plist utf-8 value as utf-16

I'm working on an iphone app that needs to display superscripts and subscripts. I'm using a picker to read in data from a plist but the unicode values aren't being displayed corretly in the pickerview. Subscripts and superscripts are not being recognized. I'm assuming this is due to the encoding of the plist as utf-8, so the question ...

How to pass an array in by reference to a function in Objective C

Greetings everyone! I have a function that has an array pointer passed it to modify stuff in an array: (void) arrayFunction:(Byte[])targetarray { // do stuff to targetarray } It's an array of type Byte, but I don't think that I've put the right thing in the round brackets. What should it be instead of (Byte[])? There may be several...

How can my app detect a change to another app's window?

In Cocoa on the Mac, I'd like to detect when a window belonging to another app is moved, resized, or repainted. How can I do this? ...

MPMoviePlayer Orientation

I am playing MP3 audio via a URL using the MPMoviePlayer. But when it plays, it flips to Landscape layout, and I would like it to remain in portrait layout. Any ideas? Thanks, John ...

MPMoviePlayer Audio Album art

I am streaming an MP3 file using MPMoviePlayer, and I would like to have an image displayed instead of the default Quicktime logo in the background. I found out a way to have an image overlay the player, but the problem with that, is you have to tap outside the image to get the player controls to appear. And when they do appear, they a...

Using predicates on an array controller to filter related objects

I have an application using Core Data and bindings. I want to have an NSSearchField that can search through an NSArrayController bound to an NSTableView. The array controller contains Core Data objects that have a "name" field. I have setup the NSSearchField like this: Bind To: the array controller Controller Key: filterPredicate Pre...

How to set rectangle border for custom type UIButton

I am trying to set an image as the background of a custom UIButton. I was able to set a background image for the "rounded rect" UIButton in interface builder, but now the borders have vanished. Is there any way to retain the borders? Also, I would like to make the borders show up rectangular instead of rounded. ...

Is it possible to set up a Linux box with distcc to build my XCode projects?

I have a mac mini on which I do some iphone and other experimental development. It is hideously slow to build some of the larger projects I have tried out (like 3d engines and such). There are some support for distributed builds with distcc and I have a quad core linux box just standing idle beside it. The question is: is it possible to...

In objective-C (iphone), how do I manage the memory of '@protocol' references?

I thought I had a pretty good handle on memory management for objective-c, but I can't figure out the following situation: @protocol MyProtocol @end @interface MyObject : NSObject { id<MyProtocol> reference; } @property (nonatomic, retain) id<MyProtocol> reference; @end @implementation MyObject @synthesize reference; -(vo...

Is it possible to create a UITabBarController whose tabbar items have text labels only (no icons)

In iPhoneOS, I want to create a UITabBarController for global app navigation (like the 'Phone' app and many others) whose tabbar items have text labels, but no icons. I would therefore also like the height of the tabbar to be much shorter. The tabbar should only be tall enough to accomodate the text labels or Apple's minimum recommende...

how do I store data from sqllite database via iphone development

Hello i have a problem in storing data on server from sqlite database. Here is my code NSString *query = @"SELECT ROW,PHOTO1 BLOB,BLG_NAME TEXT,ST_NO TEXT,ST_NAME TEXT,ST_DIR TEXT,MUNI TEXT,PROVINCE TEXT,BLG_TYPE TEXT,BLG_ACC TEXT,BLG_AMN TEXT,LONGI TEXT,LATI TEXT FROM ATTRI4 WHERE FLAG = ?"; sqlite3_stmt *statement; if(sqlit...

Is [NSString hash] computed every time?

If I have an immutable string is the hashing algorithm run every time I call hash, or does it remember the value (given that the string can't change)? ...

Mixing procedural and Object oriented programming

So, a long long time ago I used to program procedurally initially with Basic on my first BBC Model B and then a small amount of Pascal at university as well as assembly along the way. Then along came OO which seemed much more sensible all round and that was all I used with C++, Perl, Java, Ruby..... Coming back to programming non web s...

iPhone & SQLite: Some database changes are not persisting after app close and relaunch.

Hi there, I've got an iPhone app I'm developing and when the app launches I open an SQLite database connection, and I close it when the application terminates. The database is correctly in the applications documents folder. During the lifetime of the app I run several INSERT and UPDATE statements. However, for some reason my UPDATE sta...

Convert UIWebview contents to a UIImage

I am using a UIWebView to display HTML formatted text. I am not loading a webpage, just supplying a string of HTML to the UIWebView. Now I want to animate this UIWebView on screen, actually several of them (2-10 at a time). UIWebView is a little heavy, and although I haven't attempted it yet, I am planning for the worst. (I don't think...

How to build a library for two architectures (simulator, iphoneos) in XCode

I made a little library for the IPhone that I would like to redistribute, but I cannot find how to compile it to work on both the simulator and the iphoneos. I know there is a way to build a lib.a for both architecture, but I cannot figure it out. ...

What would you consider to be called a "helper method"?

I am wondering what kind of methods are "helper methods". Where do we have to draw te border to say that an specific method is a "helper method"? Actually, I consider any method to be a "helper method" if it's not an initialization method, a method implemented for conforming to an protocol or delegation response methods. Any other method...

How to get bitrate of audio file in cocoa

I need to get bitrate information from audio files, for some reason AudioFileGetProperty function with kAudioFilePropertyBitRate constant always returns 0 for me. The same with kAudioFilePropertyInfoDictionary, the resulting dictionary doesnt contain bitrate info. I would try to manualy get this from raw data in case of mp3, but I need t...

I can't seem to get the new iPhone media player framework to work

I'm working in the 3.0 SDK so I can't use specifics, but anyone who is using it might understand, I hope. I have been trying to load a view that allows you pick from a particular list of items...but I can't get it to work here's the code I'm using, made to be generic: M**********Controller *newpicker = [[M**********Controller alloc] ...