iphone

iPhone UIKit prevents custom view controller hierarchies?

Can anyone explain why it's not possible to create your own view controller hierarchies using UIKit on the iPhone? Let me explain: when creating applications using a complex view hierarchy and navigation logic, it's a good idea to have certain views controlled by a dedicated view controller. These controllers can have their own subcontr...

List with 400 items + images

What is the correct way for building a scrollable list with images that will be able to dill with 400 items? Should I use UITableView for these? What is the correct way for storing and retrieving the data? SQlite? Thanks- Nir. ...

Can you redirect log output of Xcode console to Terminal when running iPhone Simulator?

I don't like using Xcode's console output window when debugging an iPhone app in the Simulator (or on a device for that matter). I'd like to be able to use the Unix toolbox and do things like filter the logging output with grep. But to do this I need to get Xcode to send the logging output for the running iPhone app to the Terminal. Is ...

How to hook up the view of a view controller into another xib file?

I made a fresh view-based app project which has a MyProjectViewController.xib. Then I created AnotherViewController class with an acomanying XIB file. I opened MyProjectViewController.xib up in IB and dropped a "View Controller" object into my window. But now I want to hook the view of that view controllers up with the view of MyProject...

How to save aUIImage using NSUserDefaults

How do I save an Image to User Defaults ...

Why can't I change the view's size of my view controller in Interface Builder?

In addition to view based application template, I made a second view controller. When I open it's XIB in IB, I can't reduce the size of the view. It remains fullscreen. I want this view to contain some buttons only and then place this as a subview on another view. ...

Driving me crazy! animationImages always shows a memory leak

I must have tried over a dozen incarnations of this code. And looked at +100 answers. IT SHOULD BE so simple. A real basic animation, (using IB this time) but ALWAYS shows a memory leak. NO matter where I put my nil, my release, tried a zillion combinations. // implement viewDidLoad to do additional setup after loading the view, typic...

Any idea why glVertexPointer() wouldn't draw anything when using GL_FLOAT?

Using GLfixed as my vertex number type the following code draws textures as expected: GLfixed vertices[] = { (int)point.x, (int)point.y + size.height, (int)point.x + size.width, (int)point.y + size.height, (int)point.x, (int)point.y, (int)point.x + size.width, (int)point.y }; glVertexPointer(2, GL_FIXED, 0, vertices); I read...

Animating a UIImageView tint

Similar to this previous question, I want to apply an arbitrarly-coloured tint to an arbitrary image (a UIImageView). However, I want the tint to fade away over N seconds of time, to have a "pulse" effect. I'll be triggering the pulse every M seconds. While I think I could rig up a naive solution using an NSTimer to change the tint, I t...

Objective-C - where to put the NSNotificationCenter ?

Hi, i have an NSNotificationCenter selector, where to put it ? in the delegate (if yes then where?) in the controller? where to put the method as well. do i need to dealloc the NSNotificationCenter ? [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceNotificationReceived:) name:UIApplicationDidBecomeActiv...

zoomScale for OS 2.0

Hi, Is there any alternative or work around so that I can use zoomScale in Iphone OS 2.0. It seems the property is only available in Iphone OS 3.0 or later? I have two subviews in my UIScrollView and if the first subview reach a specified scale then it will change to the other subview and save the current scale to zoomScale so that the...

Updating UIImage doesn't work

Hi, I'm loading image in a view's ViewDidLoad() method like this: imgMonthGraph.Image = UIImage.FromFile("A.png"); (where imgMonthGraph is UIImageView) The above code works. However, I'd need at a later phase (not inside ViewDidLoad())to load another image to the same UIImageView. I'm tring with this code: imgMonthGraph.Image = UII...

Main thread hangs indefinitely while waiting for NSOperationQueue operations to cancel [Only on Device!]

I have an NSOperationQueue on my main thread running a set of NSOperations (max concurrent set to 1) that I want to be able to cancel at any time. When I press a button I tell the queue to cancel all operations and wait until finished. This should hang the main thread until the operation queue is empty, however it is hanging my main thre...

GSEventSetBacklightLevel from a plist value iPhone

I'm trying to set the backlight display from a plist value, but I keep getting an error! So I guess my question is how can I convert a plist value to a float value so I can set the backlight form the plist entry? The Code: float customBacklight = (float)[[plistDict floatForKey:@"Backlight Level"] floatValue]; GSEventSetBacklightLevel(c...

Getting pixel data from UIImageView -- works on simulator, not device

Based on the responses to a previous question, I've created a category on UIImageView for extracting pixel data. This works fine in the simulator, but not when deployed to the device. I should say not always -- the odd thing is that it does fetch the correct pixel colour if point.x == point.y; otherwise, it gives me pixel data for a pixe...

Is it possible to make a pattern for a CGContext Path using a png

I want to make a path that has a png as it's pattern, or if you could or think it would be easier to make my own pattern, then tell me that also. I will be greatful to anyone who can put up some code. Thanks in advance ...

How do I avoid having JSONP returns cached in an HTML5 offline application?

I had good luck with cached offline apps until I tried including data from JSONP endpoints. Here's a tiny example, which loads a single movie from the new Netflix widget API: <!DOCTYPE html> <html manifest="main.manifest"> <head> <title>Testing!</title> </head> <body> <p>Attempting to recover a title from Netflix now.....

making a text field required in objective-c

I'm currently in the process of developing an app for the iPhone. There is a screen which requires users to enter their data in text format but it can easily be skipped by simply clicking the 'submit' button. Is there a way I can make these text fields required? ...

iPhone app with audio files is just too big. How do I reduce the size?

I have a BlackBerry app that I am about to port to the iPhone. The app contains mp3 files which causes the BlackBerry version to be about 10MB in size (even after I reduced the quality of the files to 92kbps). 10MB won't do for the iPhone. Does anyone know of any best practices when it comes to including audio files in your iPhone app? I...

Placeholder objects in Interface Builder

Could someone explain the kinds of placeholder objects that may appear in the Interface Builder document window? The kinds of placeholders that I know exist are: File's owner, First Responder and App Delegate Links: This thread explains First Responder. This thread explains the App Delegate. iPhone Interface Builder and Delegates: An...