objective-c

avTouchController VU meter for iphone radio app

Hi friends, I'm trying to implement the VU meter code sample from http://developer.apple.com/iphone/library/samplecode/avTouch/Introduction/Intro.html in my iPhone Radio app. Until now no joy. My question: is it possible to implement this VU meter, from AVAudioPlayer class, in my code, that uses another object that parses the mms str...

Cocos2d v 0.99 - does it work on OS3?

Hi, Is the latest version of Cocos2D compatible with iOS3? When I change #define CC_ENABLE_PROFILERS 1 in ccConfig, I'm able to compile the file in iOS4. However, trying to run the file in iOS3 is giving me an error in iOS3 (I tried #define CC_COMPATIBILITY_WITH_0_8 1) as well. Thanks, Tee ...

How do you "speak" a function name to another programmer in objective-c

In c#, if I wanted to tell another programmer to look at a specific function such as Person.GetAge() I would "speak" that function something like... "Look at Person dot GetAge" In objective-c this function is [Person getAge] (there is no "dot"). How do people "speak" this to other developers? ...

Adding objects to a NSMutableArray property

Hi guys, this is my data strucure: group [1...n] { id, name, elements : [1...n] } I define a class for element with all properties and a class for group as: @interface Group : NSObject { NSInteger groupID; NSString *groupName; NSMutableArray *elements; } @property (assign, readwrite) NSInteger g...

How to customize a UIDatePicker in countdown mode

I want to customize the minimum time the user can pick on a UIDatePicker in countdown mode. I want it to only allow a minimum interval of 30min but the picker always displays 0 and then the subsequent intervals. If I set a 5min interval, is there any way to have the picker show {30min, 35min, 40min, ... } ? Thanks! ...

Iphone-sdk: Wifi access point mac address

Hi, I need the wifi access point mac address for my class project. I tried googling. I found a some code in code.google (stubler) http://code.google.com/p/iphone-wireless/source/browse/#svn/trunk/Stumbler But this does not seem to work for me. Can anyone please help with this. Thanks ...

Capture video from camera in Mac OS X

How I can filter video stream from camera in MacOS X. I write quicktime sequence grabber channel component, but it`s work only if app used SG API. If app used QTKit Capture the component is not worked. Somebody know how I can implement it? ...

How to make UIWebView not act like a browser on the iPhone

My app loads webpages off the internet using a UIWebView. However I'd like to modify the experience so the user won't perceive it to be a webpage. What are some of the things I can do? and how to do it? examples: - Show the page when everything is loaded? - Fade in effect? Suggestions please. ...

Problem With A Subview To Window Iphone sdk 4

The following code is in my "switchviewcontroller.m" file - (void)viewDidLoad { MainView *mainController=[[MainView alloc] initWithNibName:@"Blue View" bundle:nil]; self.mainViewController=mainController; [self.view insertSubview: mainController atIndex:0]; [mainController relea...

Inner Shadow in UILabel

is it possible to create such a UILabel with inner and outer shadow? i only know shadowColor and shadowOffset zoomed: thanks! ...

How would I drag UITextView around the view screen?

Hi, I have a project where a UITextView (for multilines) can be dragged around the screen. So far my solution to this has been an overlay of an invisible UIButton which when dragged its center is the same as the UITextView's center. However I've seen apps that seem to just allow the UITextView to be dragged and edited on the fly so it...

How to set margins (padding) in UITextView?

I have a UITextView for text editing. By default, it has a small margin around the text. I want to increase that margin by a few pixels. The contentInset property gives me margins, but it does not change the text "wrap width". The text is wrapped at the same width, and the extra "margin" just causes the view to scroll horizontally. ...

How do I draw a simple ellipse using CoreGraphics on the iPhone (specifically iPad)?

Just wondering how to draw an ellipse using CoreGraphics. ...

How to change default/preference for ObjC method on MacOSX?

MacOSX 10.6 has a method setWantsRestingTouches with a default of No, but I'd like to somehow change the default to YES. (Otherwise, I'd have to request developers of each app I use to make this a settable preference and invoke that method accordingly.) Is there some conventional way to translate from a method name to a global preferen...

Duplicate symbol issues

During a refactor of an iOS project, I ran into this bear of a bug. During the linking phase, I get this message: ld: duplicate symbol _OBJC_IVAR_$_TinCanViewController.currentViewController in /path/to/TinCanViewController-E98A666B7AF2673A.o and /path/to/TinCanViewController-E98A666B7AF2673A.o As far as I can tell, it looks like i...

iPhone Objective-C OAuth: A more elegant way to check if a request token is still valid?

I want to do this when the app loads, so I can either ask the user to log in (if not authenticated) or else continue. The only way I can think of is to call a random request (a GET that requires authentication) and check whether or not I get a valid response, but this seems inelegant. I am using the Foursquare API. Are there better w...

Possible to get a CCTexture from CCSpriteFrameCache (Cocos2d)?

So here's what I'm trying to do: Create a sprite from the atlas I read into CCSpriteFrameCache (working fine.) Add an animation to the sprite - I can also get this working fine but... The animation is created by loading up a number of CCSpriteFrames, which in turn are reading in CCTextures from a shared CCTextureCache as their assets....

Passing argument 1 of 'setQuantity:' makes pointer from integer without a cast

I have a UILabel that I need to get the value from as an integer so I can save it to my Core Data object but I keep getting this error and failure at this point. PurchaseOrderItem *newPOItem = (PurchaseOrderItem*) [NSEntityDescription insertNewObjectForEntityForName:@"PurchaseOrderItem" inManagedObjectContext:managedObjectContext]; ...

Displaying last state of application on startup?

According iPhone application programmer guide, an application should load with the state it was in when last quit. This requirement surely brings better usability but also requires some coding effort... My question is: since iPhone OS 4.0 is released and is keeping last application state automatically, is this effort really justified ...

What is the best way to write a hybrid iPhone app?

I'm developing an iPhone application that will access XML files (or something similar) from a server. I want to convert that data into a slick, native UI on the iPhone. With my current knowledge I could already do this by loading the files, parsing them, writing custom code to fill in data structures and convert the data into user interf...