Search Results

Search found 19072 results on 763 pages for 'iphone sdk 4'.

Page 52/763 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • IPhone sdk, more accurate collision detection and set the frame/bounds of UIImageView...

    - by Harry
    Hey, Im having a big problem with my app at the moment, its all too inaccurate. I have a image of a ballooon, https://dl.dropbox.com/u/2578642/Balloonedit.png And i have a dart which if it collides into the balloon the game ends. At the moment i am populating the image of the balloon with 8 UIImageViews. and i am detecting if the dart hits them, this was suppose to make it really accurate but its not, the dart pretty much passes through the balloon when its meant to collide, so i have a plan, is there any way to detect when the dart hits the actual image of the balloon not the UIImageView, or is there any way to draw a border around the balloon and detect if it hits that? currently i am using this code to detect the collision: if (CGRectIntersectsRect(pinend.frame, balloonbit1.frame)){ [maintimer invalidate]; accelManeger.delegate = nil; [ball setImage:img]; [UIImageView beginAnimations:nil context:NULL]; [UIImageView setAnimationDuration:0.3]; ball.transform = CGAffineTransformMakeScale(2, 2); [UIImageView commitAnimations]; } So in one method there are 40 of these bits of code and as you can imagine it is not very accurate/fast to respond. So like i said is there a way to draw a border or something around the balloon and detect the collision between the border and dart? Because then i would imagine it would run a lot smother because it would only have to process 5 bits of code. Thanks for any help. This is a big Question so if you can answer it i will buy your app :) Cheers, Harry :/

    Read the article

  • IPhone SDK removal of NSLog causes NSArray to be undeclared !

    - by Maxwell Segal
    I have a working application I'm about to distribute and am tidying up NSLog statements in it. When I remove NSLog from from a "case" statement, the NSArray declared within the "case" statement errors as Expected expression before AND undeclared. Anybody any idea why this may be? This is happening on all case statements in my app where I'm now removing NSLog. An example code sections appears below: switch (chosenScene) { case 0: //NSLog(@"group1"); // the following NSArray errors with "expected expression.." AND "..group1Secondsarray undeclared" NSArray *group1SecondsArray = [NSArray arrayWithObjects: @"Dummy",@"1/15",@"1/30",@"1/30",@"1/60",@"1/125",@"1/250",nil]; NSArray *group1FStopArray = [NSArray arrayWithObjects: @"Dummy",@"2.8",@"2.8",@"4",@"5.6",@"5.6",@"5.6",nil]; NSString *group1SecondsText = [group1SecondsArray objectAtIndex:slider.value]; calculatedSeconds.text = group1SecondsText; NSString *group1FStopText = [group1FStopArray objectAtIndex:slider.value]; calculatedFStop.text = group1FStopText; [group1SecondsText release]; [group1FStopText release]; break;

    Read the article

  • Why is my iPhone SDK 3.2 iPad code showing a white screen?

    - by Anthony Glyadchenko
    I'm trying to get a UISplitViewController working with an iPad app. I have the table view controller linked up under the Master pane and a plain UIView under the Detail view. I also have [window addSubview:splitView.view]; in my code. For some reason I just get a white screen even though the table view controller code is properly coded and linked under my nib. Any help would be great! Thanks! Here's where you can find the code: http://drop.io/s28bu4t/asset/mydevice-hd-zip

    Read the article

  • How to save iphone screen shot as jpeg image?

    - by Ali
    Hi I am working on an app where I need to save a part of iphone's screen shot as JPEG and then send this through email. The part of screen has some text labels, fields etc. Any ideas please on how can I save part of screen as JPEG (I am a newbie therefore any help/sample code is highly appreciated)

    Read the article

  • Call a Phone number and pass DTMF using the iPhone SDK

    - by datag
    Please suggest me to achieve the below requirement using iphone SDK. 1) Programatically Dial a Phone Number through the iPhone SDK 2) Send additional DTMF after the number is called. After googled found tel URL scheme is available to make a call. Not sure about sending DTMF tones. Please help me. https://developer.apple.com/iphone/library/featuredarticles/iPhoneURLScheme_Reference/Articles/PhoneLinks.html Thanks

    Read the article

  • Iphone sdk, How to post data to web server? anybody has example ?

    - by user352385
    Hi, guys, I want to post data to web server, like username and password, on the web server, I used PHP to echo yes or no, I attached all the code. Can anybody help me out, what is wrong with the code. Since it always says incorrect password or username. I tried to test the php code with username and password inside, it is working. So please help me. Thank you. Header file @interface kiksyloginViewController : UIViewController { IBOutlet UITextField *usernameField; IBOutlet UITextField *passwordField; IBOutlet UIButton *loginButton; } @property (nonatomic, retain) UITextField *usernameField; @property (nonatomic, retain) UITextField *passwordField; @property (nonatomic, retain) UIButton *loginButton; (IBAction) login: (id) sender; @end Implementation file #import "kiksyloginViewController.h" @implementation kiksyloginViewController @synthesize usernameField; @synthesize passwordField; @synthesize loginButton; (IBAction) login: (id) sender { NSString *post =[NSString stringWithFormat:@"username=%@&password=%@",usernameField.text, passwordField.text]; NSString *hostStr = @"http://localhost/userlogin.php"; hostStr = [hostStr stringByAppendingString:post]; NSData *dataURL = [NSData dataWithContentsOfURL: [ NSURL URLWithString: hostStr ]]; NSString *serverOutput = [[NSString alloc] initWithData:dataURL encoding: NSASCIIStringEncoding]; if([serverOutput isEqualToString:@"Yes"]){ UIAlertView *alertsuccess = [[UIAlertView alloc] initWithTitle:@"Congrats" message:@"You are authorized " delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [alertsuccess show]; [alertsuccess release]; } else { UIAlertView *alertsuccess = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Username or Password Incorrect" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [alertsuccess show]; [alertsuccess release]; } } (void)didReceiveMemoryWarning { // Releases the view if it doesn’t have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren’t in use. } (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } (void)dealloc { [super dealloc]; } @end PHP file <?php //$Container = new Container ; $u = $_GET['username']; $pw =$_GET['password']; $check = "select username, password from user where username='$u' and password='$pw'"; function myDbconn() { mysql_connect("localhost", "root","") or die(); mysql_select_db("test") or die (mysql_error()); } myDbconn(); $login = mysql_query($check) or die (mysql_error()); //$run = DB()-select($check); if (mysql_num_rows($login)==1){ //$row = DB()-fetch($run); //$row = DB()-fetch($login); $row = mysql_fetch_assoc($login); echo 'yes'; exit; } else { echo 'No'; exit; } ?

    Read the article

  • iPhone SDK: How to detect a row-hit while in the editing mode?

    - by Carol
    I've looked everywhere and I can't find it. I have a UITableView that contain rows of "checkmark" cells. The user clicks on a row to check/uncheck it. (It works!!!!) But I also want to allow the user to EDIT the data on that row. ... so I have an "EDIT" button at the top. The user hits it and is allowed to DELETE any rows. (That works too!!!!) But how do I also detect a "tap" on that row. Where is there some kind of a didSelectRowAtIndexPathWhileInEditMode ???? (Is that really the best way to do this: Allow "selections", and "deletions", and "editing" of each row?)

    Read the article

  • iphone SDK: How to check user set up a valid IP , Netmask , Router ???

    - by WebberLai
    It is simple to understand after this pic. I add fewtextfields in tableview I already set the keyboard style is number pad. Now the problems is 1.Do I need to create 12 textfields ???ex. UITextField *ip1,ip2,ip3,ip4....or just set different tag for textfield ? 2.How to check user enter wrong char not 3 valid numbers (even the keyboard is set number pad,but it might can paste words...) 3.How to check user did follow this setting rules ??? <1If IP1 is 0~223 , IP2 need to be set 0~255,IP3,IP4 both are 0~255 <2If IP1 is 172 ,IP2 is set 16~31.IP3,IP4 both are 0~255; If IP1 is 192 ,IP2 must be 168.IP3 IP4 are 0~255 <3Netmask set default 255.255.255.0 <4Router 0~223 ,0~255 ,0~255 ,0~255 This IP setting rules is my friends tech me this ...I not sure the rules is right or not?

    Read the article

  • Iphone SDK quesiton: How to make a Drawing method in a View class work using CGContextRef?

    - by SimpleCode
    I have these 2 methods in the View class. the drawRect method always gets called when the view is initalized. But i can't get the drawLine method to work. It doesn't do anything when it gets called. Am i supposed to deal with cgimagecontext or something like that? please help!! (void)drawRect:(CGRect)rect { // Drawing code // Drawing code CGContextRef contextRef = UIGraphicsGetCurrentContext(); //CGContextSetRGBFillColor(contextRef, 0, 0, 255, 1); CGContextSetRGBStrokeColor(contextRef, 0, 0, 0, 1); CGContextSetLineWidth(contextRef, 5.0); CGContextBeginPath(contextRef); CGContextMoveToPoint(contextRef, 0, 0); CGContextAddLineToPoint(contextRef, 320, 480); CGContextStrokePath(contextRef); } -(void)drawLine:(CGPoint)from to:(CGPoint) to { // Drawing code CGContextRef contextRef = UIGraphicsGetCurrentContext(); //CGContextSetRGBFillColor(contextRef, 0, 0, 255, 1); CGContextSetRGBStrokeColor(contextRef, 0, 128, 0, 1); CGContextSetLineWidth(contextRef, 5.0); CGContextBeginPath(contextRef); CGContextMoveToPoint(contextRef, 0, 0); CGContextAddLineToPoint(contextRef, 320, 50); CGContextStrokePath(contextRef); }

    Read the article

  • IPhone sdk stop the accelerometer from working when something happens.

    - by Harry
    Hi, I am using the accelerometer to move a few UIImageViews around the screen, at the moment the accelerometer only works when a NSTimer is at 0, this is fine. I would also like to make the accelerometer stop again when a different function happens. here is my code at the moment: -(BOOL) accelerometerWorks { return time == 0; } -(void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration{ if(![self accelerometerWorks]) return; valueX = acceleration.x*25.5; int newX = (int)(ball.center.x +valueX); if (newX 320-BALL_RADIUS) newX = 320-BALL_RADIUS; if (newX < 0+BALL_RADIUS) newX = 0+BALL_RADIUS; int XA = (int)(balloonbit1.center.x +valueX); if (XA 320-BALL_RADIUS) XA = 320-BALL_RADIUS; if (XA < 0+BALL_RADIUS) XA = 0+BALL_RADIUS; int XB = (int)(balloonbit2.center.x +valueX); if (XB 320-BALL_RADIUS) XB = 320-BALL_RADIUS; if (XB < 0+BALL_RADIUS) XB = 0+BALL_RADIUS; int XI = (int)(balloonbit3.center.x +valueX); if (XI 320-BALL_RADIUS) XI = 320-BALL_RADIUS; if (XI < 0+BALL_RADIUS) XI = 0+BALL_RADIUS; int XJ = (int)(balloonbit4.center.x +valueX); if (XJ 320-BALL_RADIUS) XJ = 320-BALL_RADIUS; if (XJ < 0+BALL_RADIUS) XJ = 0+BALL_RADIUS; int XE = (int)(balloonbit5.center.x +valueX); if (XE 320-BALL_RADIUS) XE = 320-BALL_RADIUS; if (XE < 0+BALL_RADIUS) XE = 0+BALL_RADIUS; int XF = (int)(balloonbit6.center.x +valueX); if (XF 320-BALL_RADIUS) XF = 320-BALL_RADIUS; if (XF < 0+BALL_RADIUS) XF = 0+BALL_RADIUS; int XH = (int)(balloonbit8.center.x +valueX); if (XH 320-BALL_RADIUS) XH = 320-BALL_RADIUS; if (XH < 0+BALL_RADIUS) XH = 0+BALL_RADIUS; ball.center = CGPointMake (newX, 429); balloonbit1.center = CGPointMake (XA, 429); balloonbit2.center = CGPointMake (XB, 426); balloonbit3.center = CGPointMake (XI, 410); balloonbit4.center = CGPointMake (XJ, 415); balloonbit5.center = CGPointMake (XE, 409); balloonbit6.center = CGPointMake (XF, 427); balloonbit8.center = CGPointMake (XH, 417); } This all works fine, i would now like to stop the accelerometer from working, using the same accelerometerWorks method or a new method, accelerometerWontWork. This is the code that when it is called i would like the accelerometer to stop. (it is very long so i wont put all of it there, but its all the same throughout): -(void) checkCollision{ if (CGRectIntersectsRect(pinend.frame, balloonbit1.frame)){ if (balloonbit1.frame.origin.y pinend.frame.origin.y){ [maintimer invalidate]; levelfailed.center = CGPointMake (160, 235); } } if (CGRectIntersectsRect(pinend.frame, balloonbit2.frame)){ if (balloonbit2.frame.origin.y pinend.frame.origin.y){ [maintimer invalidate]; levelfailed.center = CGPointMake (160, 235); } } if (CGRectIntersectsRect(pinend.frame, balloonbit3.frame)){ if (balloonbit3.frame.origin.y pinend.frame.origin.y){ [maintimer invalidate]; levelfailed.center = CGPointMake (160, 235); } } } I understand that i may have to turn this into a BOOL. Thats fine. If i haven't explained it well please say and i will re write it. Thanks! Harry.

    Read the article

  • How to get call notification using mobile substrate on iphone?

    - by prathumca
    Hi all, I want to use mobile substrate to "hook" some code into IPhone's "MobileCal" app so that the injected code will send a notification to my app MobileCal gets a call notification. But I'm out of luck and no clue which method need to be replaced by my "hooking" method in the "MobileCal" app. For example, the "MobileLog" and "iRealSMS" has the same functionality and they used mobile substrate to hook their code into "MobileCal" app. If any one has any clue, I would definitely appreciate them.

    Read the article

  • iPhone SDK: Know when tab on Tab Bar is clicked?

    - by Nic Hubbard
    I have a tab bar which displays different views when clicked. When you click a tab for the first time, it calls the viewDidLoad method. But, it only calls that the first time. Is there a method that is called when a user clicks back to that tab, since the viewDidLoad won't be called that second time? (I need to do this to update a UITableView when the user clicks back to a tab)

    Read the article

  • How can I detect if an iPhone OS device has a proximity sensor?

    - by Batgar
    The docs related to proximity sensing state that if the proximity sensing APIs are used on a device without a proximity sensor (i.e. iPod touch, iPad) they will just return as if the proximity sensor has fired. Aside from checking the [[UIDevice currentDevice].model] string and parsing for "iPhone", "iPod touch", or "iPad" is there a slicker way to determine if a proximity sensor is on a given device?

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >