iphone

Determine iPhone user's country

I need to determine at startup what country a user is in, for an iPhone application. Presumably I will have to turn on location services and do some sort of reverse geocoding. I don't really want to use a third party web service if possible, are there any other suggestions for determining country from what location services provides? In...

how to make a sprite goes behind another sprite

I'm using CCSprite to redraw my app's background image (it's like a moving background). However I'm also using CCSprite to draw my hero and enemies. At some cases the enemies goes behind my background image. My understanding is that if you do: [self addChild:sprite1]; [self addChild:sprite2]; Then sprite1 will be behind sprite2 if the...

The item you tried to buy is no longer available [Environment: Sandbox]

I am trying to put In App purchase in my application. I had setup a consumable product which was working fine in Sandbox environment. Now i just made a new product which is non-consumable with new price tier, and deleted the old one. Update my code, with the new Product ID. When request is sent, it properly shows the right Product with n...

UITableView and UITableCellView, how does this work with core plot ?

Hello, I'm very new to iPhone programming, and I'm currently following tutos to understand the whole thing. I've been able to do what I needed (retrive data from a JSON http server, parse them with YAJL and plot the data in core plot). I have done this in a "simple" view where I have added a UILayerHostingView as requested by core-plot....

Problem with UITextView

I have a strange problem with trying to pass a string from one viewcontroller to another view controller if the string originates from a UITextview instead of UITextfield. Both UITextview.text and UITextfield.text are of type NSString. The following code takes either Textfield.text or Textview.text depending on the fieldType and puts i...

multi Image: scroll as well as resize.

hi Guys I have 5 images. I want to display each image on a page (paging). And per page can resize the image on that page (other pages still not changes). How can i do it? THank you. ...

EXC_BAD_ACCESS due to PostNotification

Hello All, I am facing one issue regarding one module let me clear the flow for the same. I have one customized UITableviewCell. When I am getting some new information I am posting one notification [[NSNotificationCenter defaultCenter] postNotificationName:KGotSomething object:nil userInfo:message]; In view where I am maintaining t...

Why doesn't genstrings convert NSLocalizedStringFromTable entries to table.strings?

In my source code I have some lines like NSLocalizedStringFromTable(@"Info", @"en", @"Title of this view"). When I subsequently call genstrings -o en.lproj ./Classes/*.m I would not get the expected file en.strings but Localized.strings, although I've read in the genstrings-manpage that it would generate a table.strings file from NSLocal...

Quartz 2D: draw from a CGContext to another CGContext

I have a CGBitmapContext (bitmapContext) and I would like to draw some rectangle part (rect) of it to the current CGContext (context). Right now I do that way: CGContextRef context = UIGraphicsGetCurrentContext(); CGImageRef cgImage = CGBitmapContextCreateImage(bitmapContext); CGContextClipToRect(context, rect); CGContextDrawImage(cont...

IPhone .sqlite file place

Hello guys! How can I change the place of the .sqlite file in my directory structure. Now it is in the Documents, but I want it to be in the Library/Preferences. Can you help me please? ...

getting the x,y location while using the UIScrollview

i am using iphone simualator3.2. while i am placing the UIScrollview on the Imageview, the x,y coordinations doesn't displayed in the console. Please give me the solution to rectify this problem ...

Hiding a Bar button item in the view

How can you able to hide the (done) bar button item in a view? Basically, I have a view controller added with navigation bar (in IB) then, I also added a bar button item into the nav bar. I just want initially the (done) bar button item is hidden.. when input is in the text view the (done) button is already visible. Any idea on this im...

Play and record streaming audio

I'm working on an iPhone app that should be able to play and record audio streaming data simultaneously. Is it actually possible? I'm trying to mix SpeakHere and AudioRecorder samples and getting an empty file with no audio data... Here is my .m code: import "AzRadioViewController.h" @implementation azRadioViewController static const...

How to animate a UIButton selected background Image

hi all, I have a class defining a custom UIButton. I configurate a normal and selected state like this: //custom image UIImage *image = [UIImage imageNamed:@"customIconCreationBG.png"]; UIImage *stretchImage = [image stretchableImageWithLeftCapWidth:0.0 topCapHeight:0.0]; [self setBackgroundImage:stretchImage forState:UIControlStateNo...

Iphone: How to move the tableview down to the navigation view?

Hi, I have a window project created, which has Tabbar controller, Navigation bar. And clicking on first tab bar item shows a Tableview. I have added a small rectangle view (width: 320; height: 35) under the navigation bar additionally to have some controls there. It is attached with top Navigation bar. But after attached a rectangle vie...

why most of the objects we create in iphone are pointers.

why most of the objects we create in iphone are pointers..? like i create NSString *str, NSMutableDictionary *dict.. etc ...

Error while integrating Three20 to an iphone application...

I am tring to integrate Three20 to my project. I followed the same instructions given in this page Three20. But I am getting CANNOT FIND #import "Three20/Three20.h" issue. Header Search path under Project info > Build i have set as ../three20/Build/Products/three20 Please suggest me what can be the problem in my header search path set...

UINavigationController crashes in 4.0 - not <-4.0.

I'm trying to push a UIViewController with UINavigationController. It's working perfectly in any SDK prior to 4.0, but it just won't work in 4.0. I'm getting the OBJC_MSG_SEND (EXC_BAD_ACCESS) error. The UIViewController isn't nil, neither is self.navigationController. I've tried NSZombieEnabled, but nothing shows up. The UINavigation...

Plain text file in the compressed application bundle viewable by iPhone users?

There are some plain text files in my application bundle which has already been uploaded to the AppStore. These text files are read and displayed by the application. What I would like to know is, could people who downloaded the application from AppStore actually extract these text files and view them else where? Is there any encryptio...

resize an image without UIScrollView

Hi Guys I want to resize an image without UIScrollView in iPhone application. I want to use touchesMoved. How to do it? Thank you ...