iphone

Allocate a frequently used class only once?

Language - Objective-C I'm using the SoundEffect class to play a short sound. I'm using an NSTimer to call a this method: - (void)count { count++; if (count == 16) { NSBundle *mainBundle = [NSBundle mainBundle]; SoundEffect *soundEffect = [[SoundEffect alloc] initWithContentsOfFile:[mainBundle pathForResource:@"beep" ofType:@"aif"]]...

How can an underlying view know if it's rectangle got touched, no matter if directly or indirectly?

This is for learning: I have an UIView which is transparent and covers almost the whole screen. I left 50 pixels at the top. It is a child of the View Controller's view. Underneeth the UIView there's MyView that inherits from UIView, which matches the screen size. And inside this MyView class, I ask for a touch on it very simple with...

How can I use MKPinAnnotationView on top of a regular UIView (instead of on a map)

I'm writing an iPhone application that will contain a custom map -- my own image for the map, not Google's. The image isn't very large, so instead of using a library such as RouteMe, I'm opting for just a UIScrollView with an embedded image (the map). My question is: it is possible to re-use Apple's MKPinAnnotationView classes on top of...

UISearchBar Above Navigation Bar

Hi, All the applications I have ever seen, that use UINavigationBars, have the UINavigationBar right at the top of the app. If you want to use a UISearchBar then it's usually in the 'header' of the UITableView such as this... What I would like to do is to put a UISearchBar object above/outside of the UINavigationBar/Controller, but i...

possible to change topbar UITABLEview

Hello all what I would like to know is it even possible to change the Color of the top bar in this UITableView ( the nav + toolbar )(code wise). http://sites.google.com/site/iphonesdktutorials/images/navtoolbar/App.jpg Another question concerning the top bar , how do they manage to remove the backbutton like here item 1 is the one I ...

Why can't I just send my zipped Xcode project folder to a friend, and it works?

I always use one folder on my filesystem for an Xcode project. It contains all project files. When I zip it and send it to a friend, she can't just ipen the xcodeproj file. It opens, but all paths are broken and build fails because all the classes don't find the #include'd files. But when I download i.e. some example projects from apple,...

Standard way of adding Sound to an iPhone app (global volume indicator)

I have an app with various views. The main menu does not have any sounds, but the next views play sounds using the AVAudioPlayer Class. So when someone launches the app and is in the main menu, if he changes the volume on his device, he actually changes the "Ringer" volume. If he proceeds to the other views (where we have sound), when h...

UITableView Custom Cell Resets Cell Content

Okay I know I'm running up against my limits of understanding as regards objective-c, cocoa, xcode, and blah blah and so on. But here's what I'm trying to do: I have a tableview in a viewcontroller. The tableview's delegate is the viewcontroller. Viewcontroller has an outlet to the tableview. The table is put together using custom cells...

Will MonoTouch require a Mac to publish to the iPhone/iPod Touch?

I have never done any iPhone or iPod Touch development, much due to the additional need for a Mac to develop on, plus needing to learn Objective-C. With the announcement of MonoTouch now I can use .NET languages I am already familiar with, and develop on my Windows PC. However I am curious if I will still need a Mac to deploy and test ...

Realtime microphone sound level monitoring

I'm trying to access sound volume data from the microphone in realtime. I've tried AVAudioPlayer but it only monitors sounds from a source like an mp3 and not from a microphone. I've also tried The SpeakHere app but it's proving to be much tougher to understand with all the Objective C++ syntax (i'm a newbie). Is there another class simi...

Cocoa Touch Programming. KVO/KVC in the inner loop is super slow. How do I speed things up?

Hello, I've become a huge fan of KVO/KVC. I love the way it keeps my MVC architecture clean. However I am not in love with the huge performance hit I incur when I use KVO within the inner rendering loop of the 3D rendering app I'm designing where messages will fire at 60 times per second for each object under observation - potentially h...

Are the solutions to Stanford's online iPhone development course anywhere on the web?

I am working through Stanford's online CS course for iPhone development and from time to time I get stuck on something. Does anyone know if they supplied solutions to the weekly homework anywhere? It would also be nice to have something to check my work on after I finish each lesson. The course has been over for some time so I don't thin...

iPhone Simulator: build errors when using synthesized instance variables

There are two runtimes for Cocoa/Objective-C: the legacy runtime and the "modern" runtime (that's what Apple calls it). According to Apple's documentation, "iPhone applications and 64-bit programs on Mac OS X v10.5 and later use the modern version of the runtime". So far so good. Now, the "modern" runtime supports a feature called "sy...

Adding a combo box or drop-down list to UIView

I need to add a combo box or drop-down list to a UIView. I did not find such an object in the "Library" of the interface builder. How do I add this object to my UIVIEW? Do I have to inherit it from another object (which one?) or do I have to create it from scratch programmatically? Please help !!! ...

UIBarButtonItem as toggle switch for Boolean

I am currently using the following code in the AppDelegate to make a UIBarButtonItem act as a switch and adjusts a BOOL variable in the RootViewController Class: - (void)applicationDidFinishLaunching:(UIApplication *)application { ... toggleSwitch = [[UIBarButtonItem alloc] initWithTitle:@"English" style:UIBarButtonItemStylePlain ta...

Access UI elements created in Interface Builder in the controller?

This is a very simple iPhone / Cocoa question. I have a button that transitions between two views. I set most of this up using interface builder. When I click the button and the second view is displayed, how do I programmatically change the text of the button (to say 'back', for instance)? ...

iPhone/iPod capabilities detection?

Does anyone know the recommended way to check whether the device supports specific capabilities, for example the camera. I know I can detect the device the app is on with UIDevice but I was wondering if there is a way to enumerate the device's capabilities? ...

What's the most efficient way to draw a large CGPath?

Alright, I have a UIView which displays a CGPath which is rather wide. It can be scrolled within a UIScrollView horizontally. Right now, I have the view using a CATiledLayer, because it's more than 1024 pixels wide. So my question is: is this efficient? - (void) drawRect:(CGRect)rect { CGContextRef g = UIGraphicsGetCurrentContext(...

Rearranging UITableView with Core Data

I'm trying to find a code sample that shows how to handle moving/rearranging cells in a tableView when the cell uses a fetchedResultsController (i.e. in conjunction with Core Data). I'm getting the moveRowAtIndexPath: call to my data source, but I can't find the right combination of black magic to get the table/data to recognize the cha...

Can I work with M3G on iPhone OS?

I've been reading that M3G is something based on OpenGL ES...so can I work with this on iPhone OS? Did anyone do that already? ...