Search Results

Search found 2086 results on 84 pages for 'blackberry simulator'.

Page 75/84 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • UIImageView size becomes equal to the size of image it holds after autoresizing

    - by abura
    Hello, I faced a strange problem. My task is to provide scaling an image to fill the UIImageView frame. The UIImageView is a subview of another view. The code is following: CGRect frame=CGRectMake(0,0,viewSize.width,viewSize.height); UIView* backView=[[UIView alloc] initWithFrame:frame]; backView.autoresizesSubviews=YES; backView.autoresizingMask=UIViewAutoresizingFlexibleWidth; UIImageView* imgView=[[UIImageView alloc]initWithFrame:viewFrame]; imgView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; imgView.contentMode=UIViewContentModeScaleToFill; [subcellBackView addSubview:imgView]; [imgView release]; When the image arrives, it is assigned the the imgView: imgView.image=img; The image is scaled according to the imgView's size. Everything is all right until the iPhone (simulator) rotation. After first autoresizing the imgView size becomes equal to the image size (which is much greater) and overlaps its superview frame. The superview frame reacts properly to the orientation change. Could you please help?

    Read the article

  • establishing a socket connection from iPhone to MAC/PC

    - by user319572
    Hello, I just started getting into XCode and Co. What I am trying is to send accelerometer data via WLAN to a PC or MAC over a Socket connection. I am trying at the moment with the iPhone simulator, on the other site a netbook with a JAVA program shall receive a test string for starters. Unfortunately my socket will not initialize. What am I doing wrong? NSString *recStr = @"192.168.0.5"; //String with receiver IP NSHost *hoster = [NSHost hostWithName:recStr]; //create a host NSOutputStream *sendData; //create an output stream [NSStream getStreamsToHost:hoster port:8000 inputStream:nil outputStream:&sendData]; [sendData retain]; [sendData setDelegate:self]; [sendData open]; A warning says NSStream may not respond to '+getStreamsToHost:inputSream:outputStream:' So I guess parameters are wrong. But why and how to do it right? The program starts but I don't think I can send anything as long as this warning shows up (have not tried though). Thank you in advance, Andreas

    Read the article

  • Trouble getting NSString from NSDictionary key into UILabel

    - by Brian
    I'm attempting to put the value associated with the key called "duration" into a UILabel but I'm getting a blank or "(null)" result showing up in the UILabel. My NSDictionary object with its keys seems to be logging as being full of the data and keys I think I want, as such: the content of thisRecordingsStats is { "12:48:25 AM, April 25" = { FILEPATH = "/Users/brian/Library/Application Support/iPhone Simulator/3.1.3/Applications/97256A91-FC47-4353-AD01-15CD494060DD/Documents/12:48:25 AM, April 25.aif"; duration = "00:04"; applesCountString = 0; ...and so on. Here's the code where I'm trying to put the NSString into the UILabel: cell.durationLabel.text = [NSString stringWithFormat:@"%@",[thisRecordingsStats objectForKey:@"duration"]]; I've also tried these other permutations: cell.durationLabel.text = [thisRecordingsStats objectForKey:@"duration"]; and I've also tried this tag-based approach: label = (UILabel *)[cell viewWithTag:8]; label.text = [[thisRecordingsStats objectForKey:@"duration"] objectAtIndex:1]; and: UILabel *label; label = (UILabel *)[cell viewWithTag:8]; label.text = [NSString stringWithFormat:@"%@",[[thisRecordingsStats objectForKey:@"duration"] objectAtIndex:1]]; I've also tried creating a string from the key's paired value and see a "(null)" value or blankness using that too. What am I missing? I assume it's something with the formatting of the string. Thanks for looking!!

    Read the article

  • Scheme homework Black jack help....

    - by octavio
    So I need to do a game of blackjack simulator, butt can't seem to figure out whats wrong with the shuffle it's suppose to take a card randomly from the pack the put it on top of the pack. The delete it from the rest. so : (ace)(2)(3)(4)(5)...(k) if random card is let say 5 (5)(ace)(2)(3)(4)(5)...(k) then it deletes the 2nd 5 (5)(ace)(2)(3)(4)(6)...(k) here is the code: (define deck '((A . C) (2 . C) (3 . C) (4 . C) (5 . C) (6 . C) (7 . C) (8 . C) (9 . C) (10 . C) (V . C) (Q . C) (K . C))) ;auxilliary function for shuffle let you randomly select a card. (define shuffAux (lambda (t) (define cardR (lambda (t) (list-ref t (random 13)))) (cardR t))) ;auxilliary function used to remove the card after the car to prevent you from removing the randomly selected from the car(begining of the deck). (define (removeDupC card deck) (delete card (cdr deck)) ) (define shuffle2ndtry (lambda (deck seed) (define do-shuffle (lambda (deck seed) (if (> seed 0)( (cons (shuffAux deck) deck) (removeDupC (car deck) deck) (- 1 seed)) (write deck) ) ) ) (do-shuffle deck seed))) (define (shuffle deck seed) (define cards (cons (shuffAux deck) deck)) (write cards) (case (> seed 0) [(#t) (removeDupC (car cards) (cdr cards)) (shuffle cards (- seed 1))] [(#f) (write cards)])) (define random (let ((seed 0) (a 3141592653) (c 2718281829) (m (expt 2 35))) (lambda (limit) (cond ((and (integer? limit)) (set! seed (modulo (+ (* seed a) c) m)) (quotient (* seed limit) m)) (else (/ (* limit (random 34359738368)) 34359738368)))))) ;function in which you can delete an element from the list. (define delete (lambda (item list) (cond ((equal? item (car list)) (cdr list)) (else (cons (car list) (delete item (cdr list))))))) (

    Read the article

  • UIAlertViewDelegate method didDismissWithButtonIndex gets called while the phone is sleeping/locked.

    - by Rob
    I have a UIAlertView who's didDismissWithButtonIndex delegate method calls pops the view controller (same class, it's the alertview delegate and the viewcontroller) to return the user to the previous screen. The issue is that when you lock the phone before the [alert show]; is called, something is calling didDismissWithButtonIndex while the phone is locked. Since the response to that is to pop the view controller, which releases and deallocs it, I crash on the callback. What is causing this phantom button press? Seems like a framework bug, but I hate jumping to that conclusion. I'm definitely not hitting the button, because I hit a breakpoint in my code right before it's displayed. Then I lock the phone. Then I continue. I see it do the show, return to the event loop, and then, while the phone is still locked, hit my breakpoint in didDismissWithButtonIndex. There are a few internet/forum postings about similar spurious delegate calls, but no concrete answers. This is on the simulator, and the device, both OS 2.2 and OS 3.0. I'm assuming I'm missing something, but what? Update: Yeah, I created a simple project with just two view controllers, where when the 2nd view controller displays it creates the alert, and shows it. Then I NSLog in the delegate method, and when the phone is locked, it fires once while locked, and then again when it's unlocked and the button is clicked...2 log messages. But when not locked, there's only one. I guess I'll open an issue, but it seems awfully obvious to have survived this long without anyone complaining. :-) I'm going to try and work around it by making an isActive flag value when the willResignActive/didBecomeActive notifications arrive, and if the app isn't active skipping the delegate body. Update I went ahead in July after I posted this and created radar 7097363 for this issue. There's been no response. The workaround in practice works quite well, checking the active status when processing the delegate, and skipping the action if the the app is inactive.

    Read the article

  • shouldAutorotateToInterfaceOrientation won't work!

    - by Dror Sabbag
    Hey. I've been writing my Universal application in portrait mode, and now after about 15 nib files, many many viewCotnrollers, i'd like to implement the shouldAutorotateToInterfaceOrientation and desing some screens in Landscape mode. adding : - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } to ALL of my viewControllers, does not do the work. During Debug, i see that this method is called, but it just won't work! not in the simulator, not in the device, not in Iphone, not in Ipad! i've searched some answers in the forum, and saw some advises to use: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown ); } Didn't worked either, adding: [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; and [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications]; to my viewDidLoad and viewDidUnload respectively didn't worked either. I'm lost.. Any help will do! just one more info... all my Views are of type UIControl, as i needed the TuchUpInside to work. Appriciate your help.

    Read the article

  • NSFILEMANAGER CRASHING IN APP DELEGATE

    - by theiphoneguy
    I have this code in a method called from applicationDidFinishLaunching. It works in the simulator, but crashes on the iPhone. There are about 1,600 2KB mp3 files being copied in this operation. If I try to instantiate the app multiple times, it will eventually copy more each time until the app eventually will start without crashing. I am releasing everything I allocate. I have about 20GB disk space free on the iPhone. If I progressively comment out code and run it on the iPhone, the copyItemAtPath seems to be the suspect. (void)createCopyOfAudioFiles:(BOOL)force { @try { NSError *error; NSString *component; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSFileManager *fileManager = [[NSFileManager alloc] init]; NSEnumerator *enumerator = [[[NSBundle mainBundle]pathsForResourcesOfType:@"mp3" inDirectory:nil] objectEnumerator]; while ((component = [enumerator nextObject]) != nil) { NSArray *temp = [component componentsSeparatedByString:@".app/"]; NSString *file = [NSString stringWithFormat:@"%@", [temp objectAtIndex:1]]; NSString *writableAudioPath = [documentsDirectory stringByAppendingPathComponent:file]; BOOL success = [fileManager fileExistsAtPath:writableAudioPath]; if (success &amp;&amp; !force) { continue; } else if (success &amp;&amp; force) { success = [fileManager removeItemAtPath:writableAudioPath error:&amp;error]; } success = [fileManager copyItemAtPath:component toPath:writableAudioPath error:&amp;error]; if (!success) { @throw [NSException exceptionWithName:[error localizedDescription] reason:[error localizedFailureReason] userInfo:nil]; } } [fileManager release]; } @catch (NSException *exception) { NSLog(@"%@", exception); @throw [NSException exceptionWithName:exception.name reason:exception.reason userInfo:nil]; } @finally { } }

    Read the article

  • Can AVAudioSession do full duplex?

    - by Eric Christensen
    It would seem like it should be able to, but the following breakout test code can't do both: //play a file: NSArray *pathsArray = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [pathsArray objectAtIndex:0]; NSString* playFilePath=[documentsDirectory stringByAppendingPathComponent:@"testplayfile.wav"]; AVAudioPlayer *tempplayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:playFilePath] error:nil]; [tempplayer prepareToPlay]; [tempplayer play]; //and record a file: NSString* recFilePath=[documentsDirectory stringByAppendingPathComponent:@"testrecordfile.wav"]; AVAudioRecording *soundrecording = [[AVAudioRecorder alloc] initWithURL:[NSURL fileURLWithPath:recFilePath] settings:nil error:nil]; [soundrecording prepareToRecord]; [soundrecording record]; This is the minimum I can think of to individually play one file and record another. And this works just fine in the simulator. I can play back a file and record at the same time. But it doesn't work on the iphone itself. If I comment out either function, the other performs fine. The playback plays fine either alone or with both, if it's first. If I comment out the playback, the record records fine. (There's additional code to stop the recording not shown here.) So each works fine, but not together. I know audioQueue has a setting to allow both, but I don't see an analogue for AVAudioSessions. Any idea if it's possible, and if so, what I need to add? Thanks!

    Read the article

  • Changing UITableViewCell textLabel background color to clear

    - by SorinA.
    In my app i have a table view with customViewCells. i subclassed the UITableViewCell class and added an image that will load async and for the text i use cell.textLabel.text = @"someThext". for the cells the background color is set alternatively to [UIColor darkGrayColor] and whitecolor. When i run the app in the simulator and on the pone the textLabel of the cell has the background white. I want to set it to be clear, because i want the background color of the cell to be full not a strip then white then another strip. in the init method of my custom cell i added hoping that the white will turn into red but it doesn't have any effect. [self.textLabel setBackgroundColor:[UIColor redColor]]; i tried also self.textLabel.backgroundColor = [UIColor redColor]; but this also didn't work...if i add a UILabel as a subview the background color of the label can be set..but i don't want to do that because when i rotate the phone i want my labels to auto enlarge... any ideas why setting the background color of cell.textLabel doesn't work? thank you

    Read the article

  • Setting corelocation results to NSNumber object parameters

    - by Dan Ray
    This is a weird one, y'all. - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { CLLocationCoordinate2D coordinate = newLocation.coordinate; self.mark.longitude = [NSNumber numberWithDouble:coordinate.longitude]; self.mark.latitude = [NSNumber numberWithDouble:coordinate.latitude]; NSLog(@"Got %f %f, set %f %f", coordinate.latitude, coordinate.longitude, self.mark.latitude, self.mark.longitude); [manager stopUpdatingLocation]; manager.delegate = nil; if (self.waitingForLocation) { [self completeUpload]; } } The latitude and longitude in that "mark" object are synthesized parameters referring to NSNumber iVars. In the simulator, my NSLog output for that line in the middle there reads: 2010-05-28 15:08:46.938 EverWondr[8375:207] Got 37.331689 -122.030731, set 0.000000 -44213283338325225829852024986561881455984640.000000 That's a WHOLE lot further East than 1 Infinite Loop! The numbers are different on the device, but similar--lat is still zero and long is a very unlikely high negative number. Elsewhere in the controller I'm accepting a button press and uploading a file (an image I just took with the camera) with its geocoding info associated, and I need that self.waitingForLocation to inform the CLLocationManager delegate that I already hit that button and once its done its deal, it should go ahead and fire off the upload. Thing is, up in the button-click-receiving method, I test see if CL is finished by testing self.mark.latitude, which seems to be getting set zero...

    Read the article

  • Can I embed a custom font in an iPhone application?

    - by Airsource Ltd
    I would like to have an app include a custom font for rendering text, load it, and then use it with standard UIKit elements like UILabel. Is this possible? I found these links: http://discussions.apple.com/thread.jspa?messageID=8304744 http://forums.macrumors.com/showthread.php?t=569311 but these would require me to render each glyph myself, which is a bit too much like hard work, especially for multi-line text. I've also found posts that say straight out that it's not possible, but without justification, so I'm looking for a definitive answer. EDIT - failed -[UIFont fontWithName:size:] experiment I downloaded Harrowprint.tff (downloaded from here) and added it to my Resources directory and to the project. I then tried this code: UIFont* font = [UIFont fontWithName:@"Harrowprint" size:20]; which resulted in an exception being thrown. Looking at the TTF file in Finder confirmed that the font name was Harrowprint. EDIT - there have been a number of replies so far which tell me to read the documentation on X or Y. I've experimented extensively with all of these, and got nowhere. In one case, X turned out to be relevant only on OS X, not on iPhone. Consequently I am setting a bounty for this question, and I will award the bounty to the first person who provides an answer (using only documented APIs) who responds with sufficient information to get this working on the device. Working on the simulator too would be a bonus. EDIT - it appears that the bounty auto-awards to the answer with the highest nunber of votes. Interesting. No one actually provided an answer that solved the question as asked - the solution that involves coding your own UILabel subclass doesn't support word-wrap, which is an essential feature for me - though I guess I could extend it to do so.

    Read the article

  • Codesign returns exit code of 11 for xcode iphone project -- can't find documentation on exit code 1

    - by Larry Freeman
    Hi Everyone, I'm new to iPhone development. I am trying to get Xcode to run an application on a phone. The app works fine in the simulator. Initially I hit the error: The executable was signed with invalid entitlements I followed the steps here: http://stackoverflow.com/questions/1074546/the-executable-was-signed-with-invalid-entitlements But now I am getting an exit code of 11. I checked the documentation on codesign but I can't find any mention of an exit code 11 (http://gemma.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/codesign.1.html) Below is the log I am getting. Any help is greatly appreciated. I am using iPhone OS 3.1.3. Build HubPages of project HubPages with configuration Debug CodeSign build/Debug-iphoneos/HubPages.app cd /Users/larryfreeman/src/hub/mobile/HubPages/build/iphone setenv IGNORE_CODESIGN_ALLOCATE_RADAR_7181968 /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /usr/bin/codesign -f -s "iPhone Developer: Larry Freeman (LT6G4W62Z2)" --resource-rules=/Users/larryfreeman/src/hub/mobile/HubPages/build/iphone/build/Debug-iphoneos/HubPages.app/Entitlements.plist --entitlements /Users/larryfreeman/src/hub/mobile/HubPages/build/iphone/build/HubPages.build/Debug-iphoneos/HubPages.build/HubPages.xcent /Users/larryfreeman/src/hub/mobile/HubPages/build/iphone/build/Debug-iphoneos/HubPages.app Command /usr/bin/codesign failed with exit code 11 Thanks! -Larry

    Read the article

  • ERROR: iPhone Private Frameworks "No such file or directory"

    - by WrightsCS
    I have added Private Frameworks To my project. When I build in DEVICE | RELEASE everything works fine and I am able to ldid -S the application and it successfully launches on my device. However, when trying to BUILD AND GO in Simulator, I get the error "No such file or directory" as indicated below: (I also get the error twice which is strange too.) Line Location HomeProfileViewController.h:10: error: BluetoothManager/BluetoothManager.h: No such file or directory Below are the project and build settings that I currently have, maybe someone can find a mistake and let me know, that would be awesome! PROJECT SETTINGS: PRIVATE_HEADERS_FOLDER_PATH = "/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include" PUBLIC_HEADERS_FOLDER_PATH = "/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include" USER_HEADER_SEARCH_PATHS = "/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include" OTHER_CFLAGS = "-I/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include-I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include-I/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/arm-apple-darwin9/4.0.1/include-F/System/Library/Frameworks-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks-DMAC_OS_X_VERSION_MAX_ALLOWED=1050" TARGET BUILD SETTINGS: PRIVATE_HEADERS_FOLDER_PATH = "/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks" FRAMEWORK_SEARCH_PATHS = "$(inherited) $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks" USER_HEADER_SEARCH_PATHS = "/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include/**" OTHER_CFLAGS = "-I/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include-I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include-I/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/arm-apple-darwin9/4.0.1/include-F/System/Library/Frameworks-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks-DMAC_OS_X_VERSION_MAX_ALLOWED=1050" Note: The quotation marks in the paths aren't actually in my project, I put them in so the site will syntax them better. Cydia

    Read the article

  • Why does Raphael's framerate slow down on this code?

    - by Bob
    So I'm just doing a basic orbit simulator using Raphael JS, where I draw one circle as the "star" and another circle as the "planet". It seems to be working just fine, with the one snag that as the simulation continues, its framerate progressively slows down until the orbital motion no longer appears fluid. Here's the code (note: uses jQuery only to initialize the page): $(function() { var paper = Raphael(document.getElementById('canvas'), 640, 480); var star = paper.circle(320, 240, 10); var planet = paper.circle(320, 150, 5); var starVelocity = [0,0]; var planetVelocity = [20.42,0]; var starMass = 3.08e22; var planetMass = 3.303e26; var gravConstant = 1.034e-18; function calculateOrbit() { var accx = 0; var accy = 0; accx = (gravConstant * starMass * ((star.attr('cx') - planet.attr('cx')))) / (Math.pow(circleDistance(), 3)); accy = (gravConstant * starMass * ((star.attr('cy') - planet.attr('cy')))) / (Math.pow(circleDistance(), 3)); planetVelocity[0] += accx; planetVelocity[1] += accy; planet.animate({cx: planet.attr('cx') + planetVelocity[0], cy: planet.attr('cy') + planetVelocity[1]}, 150, calculateOrbit); paper.circle(planet.attr('cx'), planet.attr('cy'), 1); // added to 'trace' orbit } function circleDistance() { return (Math.sqrt(Math.pow(star.attr('cx') - planet.attr('cx'), 2) + Math.pow(star.attr('cy') - planet.attr('cy'), 2))); } calculateOrbit(); }); It doesn't appear, to me anyway, that any part of that code would cause the animation to gradually slow down to a crawl, so any help solving the problem will be appreciated!

    Read the article

  • how to load multiple images in iCarousel using this code?

    - by Dany
    i'm loading bunch of images in coverflow using i carousel but i'm not getting it?..initially i got Signal sigabart issue..after i edited some of the code the view gets displayed...Am i missing something?... #import "CollectionViewController.h" @interface CollectionViewController () @property (nonatomic, retain) NSMutableArray *items; @end @implementation CollectionViewController @synthesize carousel; @synthesize items; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)dealloc { carousel.delegate = nil; carousel.dataSource = nil; [items release]; [carousel release]; [super dealloc]; } - (void)viewDidLoad { [super viewDidLoad]; carousel.type = iCarouselTypeCoverFlow2; } - (void)viewDidUnload { [super viewDidUnload]; self.carousel = nil; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } #pragma mark - #pragma mark iCarousel methods - (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel { return [items count]; } - (NSUInteger)numberOfVisibleItemsInCarousel:(iCarousel *)carousel { return 29; } - (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view { //create new view if no view is available for recycling if (view == nil) { view = [NSArray arrayWithObjects:[UIImage imageNamed:@"gal1.jpg"], [UIImage imageNamed:@"gal2.jpg"], [UIImage imageNamed:@"gal3.jpg"], [UIImage imageNamed:@"gal5.jpg"], [UIImage imageNamed:@"gal6.jpg"], [UIImage imageNamed:@"gal7.jpg"], [UIImage imageNamed:@"gal8.jpg"], [UIImage imageNamed:@"gal9.jpg"], [UIImage imageNamed:@"gal10.jpg"], [UIImage imageNamed:@"gal11.jpg"], [UIImage imageNamed:@"gal12.jpg"], [UIImage imageNamed:@"gal13.jpg"], [UIImage imageNamed:@"gal14.jpg"], [UIImage imageNamed:@"gal15.jpg"], [UIImage imageNamed:@"gal16.jpg"], [UIImage imageNamed:@"gal17.jpg"], [UIImage imageNamed:@"gal18.jpg"], [UIImage imageNamed:@"gal19.jpg"], [UIImage imageNamed:@"gal20.jpg"], [UIImage imageNamed:@"gal21.jpg"], [UIImage imageNamed:@"gal22.jpg"], [UIImage imageNamed:@"gal23.jpg"], [UIImage imageNamed:@"gal24.jpg"], [UIImage imageNamed:@"gal25.jpg"], [UIImage imageNamed:@"gal26.jpg"], [UIImage imageNamed:@"gal27.jpg"], [UIImage imageNamed:@"gal28.jpg"], } else { } return view; } @end while running on simulator i just get the screen not images?...i got stuck here....

    Read the article

  • How to show AdMob ads in real iPhone device?

    - by iPhoney
    I want to integrate AdMob ads in my iPhone app. I'm using IB way to add the view and follow AdMob's pdf guide: 1. Add AdMob group(AdMobView.h,AdMobDelegateProtocol.h,libAdMob.a) 2. Add required frameworks(AudioToolbox,MediaPlayer,MessageUI,QuartzCore) 3. Add TouchJSON group 4. Add IBSupport group(AdViewController.h,AdViewController.m) 5. Add a 320*48 UIView in IB, add NSObject and change its class to AdViewController, link AdViewController's view to the 320*48 UIView and link AdViewController's viewController to current view controller. Now the iPhone simulator can show ads from AdMob, but when I test it on real device, I get the error "AdMob: Did fail to receive ad". I've tried to add test device's UDID to testDevices array, but still get the same error. - (NSArray *)testDevices { return [NSArray arrayWithObjects: ADMOB_SIMULATOR_ID, DEVICE_UDID, nil]; } Is there any problem in the above steps? Does anybody know why can't I get the ads in real device? By the way, what should be changed to build for real for-sale app, not just for test?

    Read the article

  • A problem of trying to implement scrolling inertia with jQuery

    - by gargantaun
    I'm trying to add some iPhone style scrolling inertia to a web page that will only be viewed on the iPad. I have the scrolling working in one direction (scrollLeft), but it doesn't work in the other direction. It's a pretty simple function function onTouchEnd(event){ event.preventDefault(); inertia = (oldMoveX - touchMoveX); // Inertia Stuff if( Math.abs(inertia) > 10 ){ $("#feedback").html(inertia); $("#container").animate({ 'scrollLeft': $("#container").scrollLeft() + (inertia * 10) }, inertia * 20); }else{ $("#feedback").html("No Inertia"); } } I've bound it to the 'touchend' event on the body. The intertia is the difference betweent he old moveX position and the latest moveX position when a touch ends. I then try to animate the scrollLeft property of a div that contains a bunch of thumbnails. As I've said, this works when scrolling to the left, but not when scrolling to the right. You can view the full source code (all in one page) or test it on your iPhone or iPad (or in the simulator) here http://www.appliedworks.co.uk/files/times/swipegal.html Any ideas?

    Read the article

  • AVAudioRecorder Won't Record On Device

    - by Dyldo42
    This is my method: -(void) playOrRecord:(UIButton *)sender { if (playBool == YES) { NSError *error = nil; NSString *filePath = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat: @"%d", [sender tag]] ofType:@"caf"]; NSURL *fileUrl = [NSURL fileURLWithPath:filePath]; AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:fileUrl error:&error]; [player setNumberOfLoops:0]; [player play]; } else if (playBool == NO) { if ([recorder isRecording]) { [recorder stop]; [nowRecording setImage:[UIImage imageNamed:@"NormalNormal.png"] forState:UIControlStateNormal]; [nowRecording setImage:[UIImage imageNamed:@"NormalSelected.png"] forState:UIControlStateSelected]; } if (nowRecording == sender) { nowRecording = nil; return; } nowRecording = sender; NSError *error = nil; NSString *filePath = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat: @"%d", [sender tag]] ofType:@"caf"]; NSURL *fileUrl = [NSURL fileURLWithPath:filePath]; [sender setImage:[UIImage imageNamed:@"RecordingNormal.png"] forState:UIControlStateNormal]; [sender setImage:[UIImage imageNamed:@"RecordingSelected.png"] forState:UIControlStateSelected]; recorder = [[AVAudioRecorder alloc] initWithURL:fileUrl settings:recordSettings error:&error]; [recorder record]; } } Most of it is self explanatory; playBool is a BOOL that is YES when it is in play mode. Everything works in the simulator however, when I run it on a device, [recorder record] returns NO. Does anyone have a clue as to why this is happening?

    Read the article

  • iPhone app memory leak with UIImage animation? Problem testing on device

    - by user157733
    I have an animation which works fine in the simulator but crashes on the device. I am getting the following error... Program received signal: “0”. The Debugger has exited due to signal 10 (SIGBUS) A bit of investigating suggests that the UIImages are not getting released and I have a memory leak. I am new to this so can someone tell me if this is the likely cause? If you could also tell me how to solve it then that would be amazing. The images are 480px x 480px and about 25kb each. My code is below... NSArray *rainImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"rain-loop0001.png"], [UIImage imageNamed:@"rain-loop0002.png"], [UIImage imageNamed:@"rain-loop0003.png"], [UIImage imageNamed:@"rain-loop0004.png"], [UIImage imageNamed:@"rain-loop0005.png"], [UIImage imageNamed:@"rain-loop0006.png"], //more looping images [UIImage imageNamed:@"rain-loop0045.png"], [UIImage imageNamed:@"rain-loop0046.png"], [UIImage imageNamed:@"rain-loop0047.png"], [UIImage imageNamed:@"rain-loop0048.png"], [UIImage imageNamed:@"rain-loop0049.png"], [UIImage imageNamed:@"rain-loop0050.png"], nil]; rainImage.animationImages = rainImages; rainImage.animationDuration = 4.15/2; rainImage.animationRepeatCount = 0; [rainImage startAnimating]; [rainImage release]; Thanks

    Read the article

  • presentModalViewController does not want to work when called from a protocol method

    - by johnbdh
    I have a subview that when double tapped a protocol method on the subview's parent view controller is called like this... - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *theTouch = [touches anyObject]; if (theTouch.tapCount == 1) { } else if (theTouch.tapCount == 2) { if ([self.delegate respondsToSelector:@selector(editEvent:)]) { [self.delegate editEvent:dictionary]; } } } Here is the protocol method with the dictionary consuming code removed... - (void)editEvent:(NSDictionary){ EventEditViewController *eventEditViewController = [[EventEditViewController alloc] initWithNibName:@"EventEditViewController" bundle:nil]; eventEditViewController.delegate = self; navigationController = [[UINavigationController alloc] initWithRootViewController:eventEditViewController]; [self presentModalViewController:navigationController animated:YES]; [eventEditViewController release]; } The protocol method is called and runs without any errors but the modal view does not present itself. I temporarily copied the protocol method's code to an IBAction method for one of the parent's view button's to isolate it from the subview. When I tap this button the modal view works fine. Can anyone tell me what I am doing wrong? Why does it work when executed from a button on the parent view, and not from a protocol method called from a subview. Here is what I have tried so far to work around the problem... Restarted xCode and the simulator Ran on the device (iTouch) Presenting eventEditViewController instead of navigationController Using Push instead of presentModal. delaying the call to the protocol with performSelector directly to the protocol, to another method in the subview which calls the protocol method, from the protocol method to another method with the presentModal calls. Using a timer. I have it currently setup so that the protocol method calls a known working method that presents a different view. Before calling presentModalViewController it pops a UIAlertView which works every time, but the modal view refuses to display when called via the protocol method. I'm stumped. Perhaps it has something to do with the fact that I am calling the protocol method from a UIView class instead of a UIViewController class. Maybe I need to create a UIViewController for the subView?? Thanks, John

    Read the article

  • Getting EXC_BAD_ACCESS without any helpful msg from NSZombieEnabled

    - by nefsu
    Hello guys. I'm a newbie to iphone development and I've been struggling with an EXC_BAD_ACCESS error I got a couple of days ago. I'm basically taking the Stanford iphone class independently and I am trying to pass an array of NSManagedObjects to a TableViewController that's supposed to display them. The application launches in the simulator and displays the data in the tableView but it immediately errors out with an EXC_BAD_ACCESS. I followed instructions here and other places on how to use NSZombieEnabled to identify prematurely released objects but this one comes without any helpful msgs even with NSZombieEnabled. My guess is it must be caused by something trying to access unassigned memory that wasn't released through release/autorelease. Or else it would have been picked up as zombie object like the other errors I have been able to fix. I'm not a c expert but does that mean something like that could happen if I were to declare an object and send it a message without ever instantiating it? I looked through my code to see if I had anything like that and I came up empty. I have the stack trace in the debugger for this but I'm not sure how to make use of it. I'm a little frustrated because I can't use breakpoints in the code to narrow down the problem any further since it seems to happen after the app has finished loading. I thought the app would just stay idle if there was no possible user interaction. Is it failing at the tail end of the load where I can't easy see it or is jut doing stuff in the background after it's done loading. And I would much appreciate any tips on how to read the stacktrace for this. Thanks for the help guys.

    Read the article

  • Monotouch or Titanium for rapid application development on IPhone?

    - by Ronnie
    As a .Net developer I always dreamed for the possibility to develop with my existing skills (c#) applications for the Iphone. Both programs require a Mac and the Iphone Sdk installed. Appcelerator Titanium was the first app I tried and it is based on exposing some Iphone native api to javascript so that they can be called using that language. Monotouch starts at $399 for beeing able to deploy on the Iphone and not on the Iphone simulator while Titanium is free. Monotouch (Monodevelop) has an Ide that is currently missing in Titanium (but you can use any editor like Textmate, Aptana...) I think both program generate at the end a native precompiled app (also if I am not sure about the size of the final app on the Iphone as I think the .Net framework calls are prelilnked at compilation time in Monotouch). I am also not sure about the full coverage of all the Iphone api and features. Titanium has also the advantage to enable Android app development but as a c# developer I still find Monotouch experience more like the Visual Studio one. Witch one would you choose and what are your experiences on Monotouch and Titanium?

    Read the article

  • ABAddressBookGetPersonCount(ab) problem

    - by prathumca
    Why the call to ABAddressBookGetPersonCount(ab); is giving the problem? I have around 2000 contacts in my address book. When my app gets started I'm trying to read the entire address book. This works perfectly on simulator but causing crash on IPhone. The crash report is pointing to 9 AppSupport 0x31fbca1e 0x31fb6000 + 27166 // CPRecordStoreGetCountOfInstancesOfClassWhere + 0x7e 10 AddressBook 0x318df668 0x318d5000 + 42600 // ABCGetPersonCountInStore + 0x88 11 AddressBook 0x318ea450 0x318d5000 + 87120 // ABAddressBookGetPersonCount + 0x8 12 MyAddressBook 0x0000ad30 0x1000 + 40240 // -[MyAddressBookController readAB] + 0x2c0 13 MyAddressBook 0x0000a8ce 0x1000 + 39118 // -[MyAddressBookController start] + 0x4a What I'm doing in "readAB"? - (void) readAB { ABAddressBookRef ab = ABAddressBookCreate(); CFArrayRef contacts = ABAddressBookCopyArrayOfAllPeople(ab); CFIndex count = ABAddressBookGetPersonCount(ab); for(int i = 0; i < count; i++) { //doing some thing... } } If you observe the above crash report, it is clearly pointing to CFIndex count = ABAddressBookGetPersonCount(ab);. Whats wrong with this code? I'm sure that this code works perfectly on firmware 3.1.2. But now I upgraded firmware to 3.1.3. Is this upgrade is causing any trouble? Regards, prathumca.

    Read the article

  • Trying to debug a 'Assertion failure in -[UIActionSheet showInView:]' error....

    - by dsobol
    I am working through "Beginning iPad Application Development" and am getting hung up in Chapter 3 where I have created a project that works with an Action Sheet. As it stands now, my application loads into the simulator just fine with no errors that I am aware of, but as it runs, it crashes with the following errors showing up in the debugger window: 2010-05-31 19:44:39.703 UsingViewsActionSheet[49538:207] * Assertion failure in -[UIActionSheet showInView:], /SourceCache/UIKit_Sim/UIKit-1145.66/UIAlert.m:7073 2010-05-31 19:44:39.705 UsingViewsActionSheet[49538:207] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: view != nil' I am sure that this is the block where the app breaks based upon my use of breakpoints. //Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { UIActionSheet *action = [[UIActionSheet alloc] initWithTitle:@"This is my Action Sheet!" delegate:self cancelButtonTitle:@"OK" destructiveButtonTitle:@"Delete Message!" otherButtonTitles:@"Option 1", @"Option 2", @"Option 3", nil]; [action showInView:self.view]; // <-- This line seems to trigger the crash.... [action release]; [super viewDidLoad]; } Am I missing something obvious, or is there more to the problem than is shown here? I have looked at the abstract for showInView and cannot divine anything there yet. I appreciate any and all asssitance. Regards, Steve O'Sullivan

    Read the article

  • VB.NET - Removing a number from a random number generator

    - by Alex
    I am trying to create a lottery simulator. The lottery has 6 numbers, the number generated must be between 1 - 49 and cannot be in the next number generated. I have tried using the OR function but I'm not entirely sure if I am using it properly. Any help would be great. Thanks. Public Class Form1 Private Sub cmdRun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdRun.Click 'Creates a new Random class in VB.NET Dim RandomClass As New Random() '#################################### Dim RandomNumber1 As Integer RandomNumber1 = RandomClass.Next(1, 49) 'Displays first number generated txtFirst.Text = (RandomNumber1) '#################################### Dim RandomNumber2 As Integer RandomNumber2 = RandomClass.Next(1, 49) If RandomNumber2 = RandomNumber1 Then RandomNumber2 = RandomClass.Next(1, 49) End If 'Displays second number generated txtSecond.Text = (RandomNumber2) '#################################### Dim RandomNumber3 As Integer RandomNumber3 = RandomClass.Next(1, 49) If RandomNumber3 = RandomNumber2 Or RandomNumber2 Then RandomNumber3 = RandomClass.Next(1, 49) End If 'Displays third number generated txtThird.Text = (RandomNumber3) '#################################### Dim RandomNumber4 As Integer RandomNumber4 = RandomClass.Next(1, 49) If RandomNumber4 = RandomNumber3 Or RandomNumber2 Or RandomNumber1 Then RandomNumber4 = RandomClass.Next(1, 49) End If 'Displays fourth number generated txtFourth.Text = (RandomNumber4) '#################################### Dim RandomNumber5 As Integer RandomNumber5 = RandomClass.Next(1, 49) If RandomNumber5 = RandomNumber4 Or RandomNumber3 Or RandomNumber2 Or RandomNumber1 Then RandomNumber5 = RandomClass.Next(1, 49) End If 'Displays fifth number generated txtFifth.Text = (RandomNumber5) '#################################### Dim RandomNumber6 As Integer RandomNumber6 = RandomClass.Next(1, 49) If RandomNumber6 = RandomNumber5, RandomNumber4, RandomNumber3, RandomNumber2, RandomNumber1 Then RandomNumber6 = RandomClass.Next(1, 49) End If 'Displays sixth number generated txtSixth.Text = (RandomNumber6) End Sub

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >