iphone

NSUserDefaults in logic test

Does NSUserDefaults work in logic tests or only in/on simulator/hardware? ...

How to copy a wchar_t into an NSString?

I'm using stringWithFormat @"%ls" to do it and I only see the first character copied, which makes me think it's still assuming it's a single byte char. Any ideas? ...

iPhone, Convenience Method or Alloc / Release?

Whilst developing for the iPhone I had a stubborn memory leak that I eventually tracked down to NSXMLParser. However whilst looking for that it got me thinking about maybe changing a lot of my convenience methods to alloc/release. Is there any good reason for doing that? In a large app I can see how releasing memory yourself quickly is a...

How to add entries to "Favorites"..?

I am working on a navigational app where i have my entries of recipes. What I need is to implement a button which will add a recipe on a favorites tab.. How can I do that? Any help would be appreciated. ...

iPhone SDK "loading" on Titanium Developer

Hi, I have tried this question on the site of Titanium and several tweets to their account, but they either ignore me or refuse to answer. I want to start using their framework, but for some reason the iPhone SDK is always "loading" when in the "TEST & PACKAGE" tab. Have you guys found a fix for this? I have: Snow Leopard 10.6.3 Tit...

Getting Tap/Touch Position when selecting a TableView cell

Hi, hope to get some help here because this is something that really makes me mad... I have a view with a tableView, and when I tap a cell I want to present a popOver window pointing the arrow to the cell I tapped. the things that I think I need is: 1- the position of the cell in the screen (not in the view, because on large tables the...

iPhone: How much OpenGL cleanup do I need to do when a context goes away?

I several views in an iPhone app which happen to use independent openGL contexts. They are not necessarily long-lived so they go away before the process does. And they have a couple textures in each. Does -releaseing the EAGLContext cause all that GL state to get cleaned up for me? Or am I leaking textures etc by not finding a place to...

iPhone SDK 3.2 Universal App issue with .xib files

Hello! So I am finding this process of universalizing my iPhone app to be a big headache! Am I alone in this? I sure hope not. Anyway, my question is regarding the .xib files for my universal application. I had my iPhone OS 3.1 running app all ready to make the universal switch. I went up to Project/Upgrade Current Target for iPad/Univ...

Trying to compile x264 and ffmpeg for iPhone - "missing required architecture arm in file"

I'm trying to compile x264 for use in an iPhone application. I see there are instructions on how to compile ffmpeg for use on the platform here: http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-October/076618.html , but I can't seem to find anything this complete for compiling x264 on the iPhone. I've found this source tree: http:...

Is it possible to sort a NSArray collection of UIView's based on their tag?

I've seen examples of something like [someArray sortUsingSelector:@selector(compare:)]; I'm looking for an example that stores a collection of UIViews and I'd like to sort them in ascending or descending order based on tags I assume programatically when a new UIView is created. If someone could provide a code example or instructions ...

Inserting image in a scrollview

How can I insert an image in a scroll view, so that I can zoom it. I am new to objective c. Any help will be greatly appreciated! ...

Obj-C memory management: why doesn't this work?

Why doesn't the following code work? MyViewController *viewController = [[MyViewController alloc] init]; [myWindow addSubview:viewController.view]; [viewController release]; As I understand, myWindow should be retaining viewController.view for as long as the window needs it. So why does this cause my app to crash on launch? (commentin...

Cocoa for the non-techinical

How would you describe and explain Cocoa in non-technical terms, with lots of analogies to common, everyday things. For example, imagine you are describing it to a 5-year-old who keeps asking why? at the end of each explanation. This would invariable delve into the theory of OO so it could get lengthy, but the concept is important to the...

iphone scanning a dat file for data

I am trying to remake a program I have made in C# in OBJ-C.In C# I used streamreader to search the data file for the line I am looking for then convert that line into a string that I can work with. I have looked at NSScanner but I'm not sure if thats quite waht I'm looking for but I'm by no means a cocoa expert. All I would like to b...

Play a wav file retrieved from a database on the iPhone?

I have alot of wav files stored in sqlite3, but when I retrieve one of them, I can't play it. The retrieve code is NSData *soundData = (NSDATA *)sqlite3_column_blob(statement, 0); mPlayer = [[AVAudioPlayer alloc] initWithData:soundData error:&error]; The data is stored as binary and it's there when I search for it using sqlite3. ...

Time Zone offset number in Objective-c?

How can I get the Timezone offset in Objective-C (for iPhone OS 3)? Example GMT -5 is US Eastern Time... I want the -5. ...

Put a UITableView into editing mode without moving the TextLabel?

I've got a UITableView that is sortable, but that's it. Right now, I have all the cells set to UITableViewCellEditingStyleNone, but this still moves the TextLabel of the cell over to the right by 40 pixels. Is there anyway to get edit mode, and the sort icon at the right, without shifting the TextLabel over? ...

How to check image during animation

I have set up an animation in the following way (self is an UIImageView, myImages an Array of UIImages): self.animationImages = myImages; self.animationDuration = 50; self.animationRepeatCount = 0; [self startAnimating]; During the animation I'd like to check the current image. I tried it the following way if([self image]==[UIImage i...

Is it possible to use a Segmented Control to change the view?

i want to use a segmented control instead of a UITabBar controller to change the view. Is that in accordance with the HIG? If yes, how can I do so? What template should I use for my project and what code? ...

How to create sleek customized buttons, tables and other views for iPhone/iPad apps?

I'm looking to know both what can be customized as well as the recommended way to customize some of the major UIView subclasses in the iPhone SDK (in particular UIButton, UITableView/Cell ... but really open to any of the views in the SDK). Any recommended tutorials? Examples? Are there bad practices that can actually hinder perfo...