iphone

iPad Modal View Dismiss Animation Issue

When I present a modal view in iPad, the view comes up from the bottom. But when I dismiss it, it slides of the screen to the left. I'm in landscape mode and using UIModalPresentationStylePageSheet. How do I make the dismiss animation slide the view back down? ...

Unexpected crash while using looking phone numbers in iPhone address book

I have a rather unexpected result with the following code: ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook); CFIndex nPeople = ABAddressBookGetPersonCount(addressBook); NSLog (@"npeople = %d = %d", nPeople, CFArrayGetCount(people)); for (CFIndex i = 0; i < nPeople;...

How can i play a beep in Button click action iphone xcode?

How can i play a beep sound in Button click action? ...

subview take touch event on all window

Hello, i have a little problem on my view. I have a uiviewControler, load a xib. on this view i have a UIButton ( on touch it's work fine) I add a subview create by code (on a different class ) this view respond to her touch event. when i add this subview on my view, the event on this view are ok, but the UIButton on my first uiview n...

Open iBooks from an iPad application

I'm creating an application for a client. The iPad will be pre-loaded with a ebook that we will be creating ourselves. This ebook will not be available in the bookstore, but will be preloaded via itunes. Is it possible to open the iBooks application from my application, via some URL schema? Is it then possible to link directly to our p...

Core-Plot crash only in Release Configuration

Hey everyone, I really don't know a solution or even an idea to get around the following failure. It only happens in Release Configuration on the Device - Simulator and Debug Configuration work fine. It also only appears on the second launch. So if I have the phone connected to my mac, build the application and run it, everything wo...

setting mailto links to open as html in iPhone/iPad HTML+JS app

The app is wrapped by PhoneGap, so I have access to change the C#. I know mailto body is sent as plain text. I've read that in OS3 a flag can be set in with the MailComposerViewController class to send html emails. I don't mind exiting the app to send an email. I just wondered if I could change a little bit of #C so that my HTML5+JS ap...

NSXMLParser and Geonames

I'm trying to parse a call from Geonames with NSXMLParser in the iPhone SDK. I've used this before but for some reason I'm getting an empty dictionary back even though I get results back in a web browser. Can someone please point out what I may be doing wrong. Below is the code I'm using and the results that comes back pasting it in a b...

Obj-C: Creating an object with a String name

Hey all. I know this sounds simple, but I can't find a way to do it. I have a method in Obj-C that takes in a NSString and then should create a new class with the String as its title. -(DataModel *)createDataModel:(NSString *)dataModel_name { DataModel *[initWithString:dataModel_name] = [[DataModel alloc] init]; } I ...

Can't compile code when working with CALayer

For some reason I get linker errors when I try and use CALayer: "_OBJC_CLASS_$_CALayer", referenced from: I have imported the following headers: #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import <QuartzCore/QuartzCore.h> Code: arrowImage = [[CALayer alloc] init]; ...

NSDictionary: convert NSString keys to lowercase to search a string on them

Hello. I'm developing an iPhone application. I use a NSDictionary to store city's names as key, and population as value. I want to search the keys using lowercase. I've using this: NSDictionary *dict; [dict objectForKey:[[city stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] lowercaseString]]; But...

How can I consolidate deferred/delayed calls in Objective-C ?

I'd like to ensure that certain maintenance tasks are executed "eventually". For example, after I detect that some resources might no longer be used in a cache, I might call: [self performSelector:@selector(cleanupCache) withObject:nil afterDelay:0.5]; However, there might be numerous places where I detect this, and I don't want to be...

Core Data confusion: fetch without tableview.

I have completed and reproduced Core Data tutorials using a tableview to display contents. However, I want to access an Entity through a fetch on a view without a tableview. I used the following fetch code, but the count returned is always 0. The data exists when the database is opened using SQLite tools. NSManagedObject *entryObj;...

Why does navigationItem.titleView align left when presentmodalviewcontroller called?

I'm using a UILabel for the titleView of a navigation bar (I'm making simple in-app web browser). It works fine, except that when I present a modal view controller, the titleView shifts from the center of the navbar to the far left (underneath the back button). I've tested in 3.0 and up. Here is relevant code: - (void)viewDidLoad { ...

Has anyone tried integrating custom fonts in UIButton?

Trying to put in FontLabel (http://github.com/zynga/FontLabel) into a UIButton. At first I wanted to set titlelabel. But it's restricting a setter to it so i can't just set the label to it. Just wondering if anyone has an idea in doing this without using images to set my custom button. ...

Google Protocol Buffers with Objective-C and Java

Hi, I'm looking at setting up communication between an iPhone app and a Java based server and thought that google protocol buffers might be the way to go; however I've managed to get myself a bit confused and I'm not sure the best way to go about implementing this so I was hoping for a bit of friendly advice :) Should I set up the Java...

how to send email without showing compose email UI?

I am writing a program to grab picture from the Photo Album on the device and automatically send it as attachment to an email address. I want to do this without displaying the MFMailComposeViewController UI (the typical iphone send email compose Window). Is this possible? thanks much in advance. ...

populate UITableView from json

Hello all working on my building my first iDevice app and I am trying to populate a UITableView with data from json result I can get it to load from plist array no propblem and I can even see my json the problem I'm having is that the UITableView never gets to see the json results please bare with me as this is first time with obj-c or a...

Multi-line strings in objective-c localized strings file

I have a template for an email that I've put in a localized strings file, and I'm loading the string with the NSLocalizedString macro. I'd rather not make each line its own string with a unique key. In Objective-C, I can create a human-readable multiline string like so: NSString *email = @"Hello %@,\n" "\n" "Check out %@.\n" ...

Why no iphone app linking contacts to calendar?

I am not a programmer. I would pay for an application that allowed me to create a link between a calendar appointment and one or more of my contacts. This seems like an obvious applications with a huge market> Why is it not possible to do this? ...