objective-c

Voice transforming using OpenAL on iPhone

Hi there, I've played a little bit with OpenAL, and I must say that it's pretty fast, even on the iPhone. However, I still got one problem. My app is recording the user voice, and repeats what he said using OpenAL. I've modified the AL_PITCH value, but it's currently also changing the speed, which I don't want to ! Is there a simple way ...

execute code only once in objective c. not every time the app launches

I want to delete a table from a sqlite3 db at certain times, i.e. after its been uploaded to a server. i want to set a flag that will mean the table does not get deleted the first time the app is launched. after that the logic will take care of when the table in the db is deleted. i'm currently using nsuserdefaults to set a flag which...

How to observe when a UIAlertView is displayed?

Is it anyway possible to observe if a UIAlertView is being displayed and call a function when it is. The UIAlertView is not being created and displayed in the same class which I want a function to be called in. Its hard to explain but to put it simply I need to somehow monitor or observe if the view becomes like out of first responder...

how can i use a particular UIActionSheet's button with some actioning (explain in brief) in iphone ?

how can i use a particular UIActionSheet's button with some actioning (explain in brief) in iphone ? ...

Removing the image from an IKImageView

I have an IKImageView that is coming up effectively un-initialized. This is happening effectively in an error-state (The user is unregistered) so I haven't had a chance to put an image in it yet. In 10.6, this comes up fine, with a black rectangle. In 10.5, however, it comes up with garbage. some rectangles of noise, some rectangles of...

Is it possible to make a for on a NSDictionary object?

Hi, the question explains it all. For instance, if I have a NSDictionary like this first = ("a", "b", "c"), second = ("d", "e", "f") third = ("g", "h", "i") And I'd like to loop on them to make some operations. Is it possible? Thanks ...

How do I use UIImagePickerController just to display the camera and not take a picture?

Hello All: I'd like to know how to open the camera inside of a pre-defined frame (not the entire screen). When the view loads, I have a box, and inside it, I want to display what the camera sees. I don't want to snap a picture, just basically use the camera as a viewfinder. I have searched this site and have not yet found what I'm looki...

Custom Alert view

hi, I want to create a custom alert view, i.e. i want to put some images and my choice color on alert view, i know how to create normal alert view, but can any one help me out in this one??? so that the application will look pretty good. regard viral. ...

Symbol Not Found, expected in Flat Namespace ObjC++

Hello, I've got probably what is a simple problem, but there's no informative errors or warnings during compile to alert me to what is going wrong. I've got a Objective-C++ app that includes a C++ main and ObjC header files. It builds fine, but when run, it gives this error message: Dyld Error Message: Symbol not found: _OBJC_CLASS...

Application crashes after when array of images are stored

Hi, I'm getting the screenshots from the following code: CGImageRef cgScreen = UIGetScreenImage(); if (cgScreen) { UIImage *result = [UIImage imageWithCGImage:cgScreen]; CGImageRelease(cgScreen); return result; } I'm calling the above code in a timer of 1/1.0 seconds as: [array addObject:[UIImage image...

[iPhone]Objective C, objects which do not conform to NSCoding. How to write them to a file.

Hi, I am using an Objective c class, a subclass of NSObject. This class cannot be modified. I have an instance of this class that I wish to write to a file which can be retrieved and later reinstate. The object does not conform to NSCoding. To sum up, I need to save an instance of a class to a file which can be retrieved later, without ...

Where should I put some code for loading application data?

I have a tab-bar and navigation controller application (like Youtube app or Contacts app). Where is the correct place to have the code for loading some data from the web? These data are necessary for all the tabs of the Tab Controller and the app can't display anything before all data are downloaded and parsed from the app (except a loa...

Transform/redraw view after pinch zoom on x-axis

My setup. UIScrollView (scrollView) - UIView (contentView) - UIView (subView) I have managed to do so I can zoom contentView only on the x-axis. The problem is that subView is containing a graph. When contentView is zoomed and transformed the graph gets unsharp and distorded since the scaling only effect the x-axis. What I need help...

iPhone stream programming (CFStream) Hello World

Hello, I am currently trying to send a Hello World from my iPhone to a remote computer running a working server (tested by telnet on iPhone). Here is my code : #import "client.h" @implementation client - (client*) client:init { self = [super init]; [self connect]; return self; } - (void)connect { CFWriteStreamRef writeSt...

NSString integerValue returns a number in hex

NSString *x = @"12345"; NSInteger nsint = [x integerValue]; NSLog(@"%x", nsint); Prints 3039. intValue has the same result. Any idea how I can get the actual decimal value out of that? ...

RSS Detector in NSXMLParser

How do I use NSXMLDetector to find RSS links in HTML files, the tags in the source are like so : <link rel="alternate" type="application/rss+xml" title="CNN - Top Stories [RSS]" href="http://rss.cnn.com/rss/cnn_topstories.rss"&gt; <link rel="alternate" type="application/rss+xml" title="CNN - Recent Stories [RSS]" href="http://rss.cnn.c...

Adding a button inside an image.

CGRect frame = CGRectMake(round((self.view.bounds.size.width - kImageWidth) / 2.0), kTopPlacement, kImageWidth, kImageHeight); self.containerView = [[[UIView alloc] initWithFrame:frame] autorelease]; [self.view addSubview:self.containerView]; // create the initial image view frame = CGRectMake(0.0, ...

Are C/C++/ObjC/JS Apple's only allowed langauges for iPhone development?

According to this post on Daring Fireball a new iPhone SDK Agreement release in conjunction with the iPhone OS 4.0 announcement today specifically bans any iPhone application not implemented in C, C++ Objective-C or JavaScript. The clear impact here is to the wide array of programs written in languages other than those. Is that your rea...

Will pool the connection help threading in sqlite (and how)?

I currently use a singleton to acces my database (see related question) but now when try to add some background processing everything fall apart. I read the sqlite docs and found that sqlite could work thread-safe, but each thread must have their own db connection. I try using egodatabase that promise a sqlite wrapper with thread safety ...

NSCollectionView subclass doesn't call drawRect during drag session despite setNeedsDisplay

Greetings, I am puzzled as to how and when drawRect is supposed to be called in a NSCollectionView subclass. I implement drag and drop operation in order to move NSCollectionViewItems within the collection, and would like to draw a visual indication of where the drop would end. The subclass does not call drawRect during the drag sessi...