Hi there,
I was working on my app recently and wanted to change the brightness of the backlight. I then wanted to restore the backlight level to it's original setting on exiting the app. Here is the code:
#include "GraphicsServices.h"
- (void) viewWillAppear:(BOOL)animated
{
NSNumber* bl = (NSNumber*) CFPreferencesCopyAppValue(CFSTR(...
I'm trying to display a UIAlertView in a top-level iPhone exception handler. The handler function looks like this:
void applicationExceptionHandler(NSException *ex) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error"
message:[ex reason]
...
BOOL continueLoop;
CGPoint thePoint;
while(continueLoop != NO)
{
continueLoop = NO;
thePoint = [self generateRandomLocation];
NSMutableArray *blocks = [self getBlocksForX:thePoint.x];
for(BlueBlock *block in blocks)
{
if(block.getBlockLocationY == thePoint.y)
{
continueLoop = YES;
}
}
[blocks release];
}
This cause...
Hello,
I'm implementing the didSelectRowAtIndexPath: method in a tableviecontroller implementation. I get a "conflicting type" warning in my code. Everything seems to work, but the warning bugs me. The code in my implementation file is as follows.
- (void *)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*)ind...
Hi all,
I have a xml source and now i would like to present in my tableview.
Source code for xml:
<NewsML>
<Catalog Href="http://www.afp.com/dtd/AFPCatalog.xml"/>
<NewsEnvelope>
<DateAndTime>20091123T171818Z</DateAndTime>
</NewsEnvelope>
<NewsItem>
<Identification>
<NewsIdentifier>
<ProviderId>afp.com</Provid...
Hi there
I developing an iPhone game and having some problem now, could anyone help me out ?
I want to open a thing on the screen, the item in the centre of the screen, and I need 2 fingers to open it. Just put 2 fingers in and move horizontally to the certain points then let go, then the thing opens.
I am making a range for the poin...
I'm starting out on objective-C and so far I was under the belief that the .h and .m file should be in sync with-respect-to method details. However it seems I can add methods to the .m file without the addition of their sig in the .h file and it will still compile fine !
For e.g. this works in the .m file without any declaration in the ...
I get a crash in WebEditorClient::clearUndoRedoOperations which is trying to access -[WebView(WebViewEditing) undoManager] when I close the main window of an NSDocument that contains a webview with a text editor in it. It only happens when there is an undo-able state. Seems like a bug in Cocoa, but I might be doing something wrong. Any i...
Hi everyone. So my problem is this:
I am receiving a JSON string from across the network. When decoded (using SBJSON libraries), it becomes an NSDictionary that SHOULD contain a number of some sort for the key 'userid'. I say 'should' because when I compare the value to an int, or an NSINTEGER, or NSNumber, it never evaluates correctly....
I've been banging my head against a wall for a few days with this. I've read every document I could find and more on the subject of OpenGL and Cocoa. I'm just not understanding where my attempts break and the other ones don't.
My code is listed below, it is fairly short as all I'm trying to do is render a rotating triangle. I am not new...
Hello,
how can i check a variable is NSArray or NSMutableArray???
Thanks
...
Hi folks,
finally I choose to devote some time to find a way/implementation to
mask text inside UITextView/UIWebView.
By now what I'm able to do is:
- add some custom background
- add a uitextview/uiwebview with some text
- add an UIImageView (with a covering png) or a CAGradientLayer to
create a simple mask effect (*)
Of course ...
I want to show alert on a specific time on iphone using push notification.I have gmt +530 timezone in my local app.Suppose current time is 16:04:08 Gmt +530 and i want notification after one hour so currently I am converting it into UTC format and storing this time and alert message on server database. i want to know will i get the notif...
Hello all,
I want to create a karaoke like application.First tell me is it possible or not.
How do i combine two sounds? suppose i am playing instrumental and want to record my voice so that i can create a new song using my voice.
...
Well I have an application that uses both Objective C & c++ but for portability reasons I have tried to use c++ as much as possible.... Now I am confronted with some problem that requires threads I was thinking of using pthread instead of NSThread.... is it Okay to use pthread... will Apple punish me for using it by rejecting my app on t...
I have a lot of experience with java and c++ development, so classes and abstracting data is pretty easy for me. I only started objective C a short time ago, and i was mostly working with in class globals, and everything was progressing smoothly. I just decided to abstract a large portion of my code in an effort to make it less spaghetti...
Hi guys,
I have a Webview that must load an image! When I upload this image I see every time the same image as before, and i must reboot my app to see the new image...
I think is a cache problem..How can I solve that??
...
hi everyone
I have a problem not sure how to solve this. Hmm I am developing a game, a multi touch game, I already can make everything working fine, except a small issue that I want to show messages on the playing screen, each time the player makes actions. like his finger moves right the message says : "this finger moving right" nicely...
More precisely my goal is to create an add-on (or plug-in?) which is able to communicate with my main Cocoa application using something like the NSDistributedNotificationCenter. I need to be able to inject JavaScript code into the current webpage and get return values from the JS calls when my add-on receives the request to do so by my m...
Just trying a few things out and noticed that this works, it does compile, but I just wanted to check if it would be considered good practice or something to be avoided?
NSString *fileName = @"image";
fileName = [fileName stringByAppendingString:@".png"];
NSLog(@"TEST : %@", fileName);
OUTPUT: TEST : image.png
Might be better writt...