Search Results

Search found 2691 results on 108 pages for 'ios 4'.

Page 54/108 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >

  • Setting Corner Radius on UIImageView not working

    - by MarkPowell
    I'm at a bit of a loss. I've used the layer property of UIView to round the corners of multiple elements in my app. However, this one UIImageView is simply not complying. Not sure what I am missing. The UIImageView (called previewImage) is contained in a Table View Cell. I've tried setting the cornerRadius property multiple location (in the cell itself and in the controller that creates the cell) to no avail. static NSString *CellIdentifier = @"MyTableViewCell"; MyTableViewCell *cell = (MyTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:CellIdentifier owner:self options:nil]; cell = [topLevelObjects objectAtIndex:0]; cell.previewImage.layer.cornerRadius = 20; //Made it 20 to make sure it's obvious. } Is there something about the way cells are loaded that I'm missing?

    Read the article

  • Avoiding Nested Blocks

    - by Helium3
    If there is a view controller that wants to execute a number of block based tasks one at a time, how can the control be given back to the view controller after a completion block has executed. Lets say ViewControllerOne wants to execute a number of tasks, each relying on the result of the previous one, how would this control be given back to the viewcontroller after each completion block has been executed? I started thinking about this and I was heading towards a deeply nested block pattern that will surely only cause confusion to whoever else reads or tests it. A task executes and the completion block returns the result or error which is needed by the next task, which has its own completion task, that the next task relies on and so forth. How can the control be managed in one place, the viewcontroller? Would the completion block just call the next function that handles the next task, using a pointer to the view controller?

    Read the article

  • What role does the Apple iTunes server play in Enterprise distribution?

    - by Piepants
    I'm looking into what's involved in distributing an Enterprise App and found this line in Apple's Enterprise App Distribution doc in the section on installing the apps wirelessly: A network configuration that allows the devices to access an iTunes server at Apple What does this mean and why is it necessary? I thought the apps to be installed would be hosted on a company web site, but does this imply otherwise? TIA

    Read the article

  • Refreshing a MKMapView when the user location is updated or using default values

    - by koichirose
    I'm trying to refresh my map view and load new data from the server when the device acquires the user location. Here's what I'm doing: - (void)viewDidLoad { CGRect bounds = self.view.bounds; mapView = [[MKMapView alloc] initWithFrame:bounds]; mapView.showsUserLocation=YES; mapView.delegate=self; [self.view insertSubview:mapView atIndex:0]; [self refreshMap]; } - (void)mapView:(MKMapView *)theMapView didUpdateUserLocation:(MKUserLocation *)userLocation { //this is to avoid frequent updates, I just need one position and don't need to continuously track the user's location if (userLocation.location.horizontalAccuracy > self.myUserLocation.location.horizontalAccuracy) { self.myUserLocation = userLocation; CLLocationCoordinate2D centerCoord = { userLocation.location.coordinate.latitude, userLocation.location.coordinate.longitude }; [theMapView setCenterCoordinate:centerCoord zoomLevel:10 animated:YES]; [self refreshMap]; } } - (void)refreshMap { [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; [self.mapView removeAnnotations:self.mapView.annotations]; //default position NSString *lat = @"45.464161"; NSString *lon = @"9.190336"; if (self.myUserLocation != nil) { lat = [[NSNumber numberWithDouble:myUserLocation.coordinate.latitude] stringValue]; lon = [[NSNumber numberWithDouble:myUserLocation.coordinate.longitude] stringValue]; } NSString *url = [[NSString alloc] initWithFormat:@"http://myserver/geo_search.json?lat=%@&lon=%@", lat, lon]; NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; [[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; [url release]; [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; } I also have a - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data, to create and add the annotations. Here's what happens: sometimes I get the location after a while, so I already loaded data close to the default location. Then I get the location and it should remove the old annotations and add the new ones, instead I keep seeing the old annotations and the new ones are added anyway (let's say I receive 10 annotations each time, so it means that I have 20 on my map when I should have 10). What am I doing wrong?

    Read the article

  • How to set Tabbar integration in iPhone?

    - by Minu
    I am working on an iPhone app, using UITabBar to develop it. Only the tabbar background is visible, but it is not showing the title inside, how to fix this? please help me, Thanks in Advance. below is the source code for your reference. UITabBar *tab =[[UITabBar alloc]initWithFrame:CGRectMake(0, 300, 320, 44)]; [self.tabBarItem initWithTitle:@"1" image:nil tag:11]; [self.tabBarItem initWithTitle:@"2" image:nil tag:11]; [self.tabBarItem initWithTitle:@"3" image:nil tag:11]; [self.view addSubview:tab];

    Read the article

  • numberOfSectionsInTableView is requested in/after viewDidLoad ONLY if tableview is empty

    - by Ben Packard
    A simple tableviewController, empty. A modal that can be launched from a button. No data in the data source for the tableview, and no rows displayed. I open the modal, use it to add an item, and return to the tableview controller. The tableview updates itself automatically, and the new row is displayed. I add a second item. The table view does NOT update automatically. I can tell by logging inside numberOfSectionsInTableView that even if I go to add the first item and cancel, the tableview refreshes - it asks for the number of sections, rows, and the cell to display (if there is one). But not if there is one pre-existing row in the table. I've scoured my code but can't find anything that would cause the tableview to know when the first item is added, but none afterwards. Any ideas? EDIT - I have further narrowed my issue so will close this shortly and post a more specific question

    Read the article

  • rendering a new line in a string (\n) with drawRect

    - by Mrwolfy
    I am trying to render a string with a new line (line break \n), using drawRect. The code below renders the my string as a single line, with no line break, even though I am using the \n character. See the second to last line. UIFont *font = [UIFont fontWithName:@"HelveticaNeue-CondensedBlack" size:fontSize]; CGPoint point = CGPointMake(0,0); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0); CGContextSetRGBStrokeColor(context, 0.0, 0.0, 0.0, 1.0); CGContextSetLineWidth(context, 4.0); CGContextSetTextDrawingMode(context, kCGTextFillStroke); CGContextSaveGState(context); [@"test \n test" drawAtPoint:point withFont:font]; CGContextRestoreGState(context);

    Read the article

  • UITableViewCell separator line disappears on scroll

    - by iconso
    I'm trying to have a separator cell with a custom image. I did try something like that: In my cellForRowAtIndexPath: NSString *cellIdentifier = [NSString stringWithFormat:@"identifier"]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier]; } cell.textLabel.font = [UIFont fontWithName:@"Helvetica" size:19]; cell.textLabel.text = [self.menuItems objectAtIndex:indexPath.row]; cell.textLabel.textColor = [UIColor colorWithRed:128/255.0f green:129/255.0f blue:132/255.0f alpha:1.0f]; cell.backgroundColor = [UIColor whiteColor]; UIImageView *imagView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"reaL.png"]]; imagView.frame = CGRectMake(0, cellHeight, cellWidth, 1); [cell.contentView addSubview:imagView]; switch (indexPath.row) { case 0: cell.imageView.image = [self imageWithImage:[UIImage imageNamed:@"img1.png"] scaledToSize:CGSizeMake(27, 27)]; cell.imageView.highlightedImage = [self imageWithImage:[UIImage imageNamed:@"route.png"] scaledToSize:CGSizeMake(27, 27)]; break; case 1: cell.imageView.image = [self imageWithImage:[UIImage imageNamed:@"img.png"] scaledToSize:CGSizeMake(27, 27)]; cell.imageView.highlightedImage = [self imageWithImage:[UIImage imageNamed:@"money.png"] scaledToSize:CGSizeMake(27, 27)]; break; case 2: cell.imageView.image = [self imageWithImage:[UIImage imageNamed:@"auto.png"] scaledToSize:CGSizeMake(27, 27)]; cell.imageView.highlightedImage = [self imageWithImage:[UIImage imageNamed:@"cars.png"] scaledToSize:CGSizeMake(27, 27)]; break; case 3: cell.imageView.image = [self imageWithImage:[UIImage imageNamed:@"impostazioni.png"] scaledToSize:CGSizeMake(27, 27)]; cell.imageView.highlightedImage = [self imageWithImage:[UIImage imageNamed:@"impostazioni.png"] scaledToSize:CGSizeMake(27, 27)]; // cell.imageView.contentMode = UIViewContentModeScaleAspectFill; break; case 4: cell.imageView.image = [self imageWithImage:[UIImage imageNamed:@"info.png"] scaledToSize:CGSizeMake(27, 27)]; cell.imageView.highlightedImage = [self imageWithImage:[UIImage imageNamed:@"info.png"] scaledToSize:CGSizeMake(27, 27)]; break; default: break; } return cell; When I lunch the app everything is good, but when I scroll the the table, or when I select a cell the separator lines disappear. How I can have a permanent custom line separator?

    Read the article

  • Reset UIKeyboard State

    - by kamziro
    I have a UITextView which the keyboard enters values into. However, if you clear the text value (i.e uitextview.text = @""), the keyboard's state does not reset to the lowercase alphabet keyboard. That is, if I was in the middle of typing "hello.." and the textview gets cleared, the keyboard still shows the symbols, rather than back to the alphabetical letters. Is there a way to get around this?

    Read the article

  • Custom UITableViewCell from xib isn't displaying properly

    - by Kenny Wyland
    I've created custom UITableCells a bunch of times and I've never run into this problem, so I'm hoping you can help me find the thing I've missed or messed up. When I run my app, the cells in my table view appear to be standard cells with Default style. I have SettingsTableCell which is a subclass of UITableViewCell. I have a SettingsTableCell.xib which contains a UITableViewCell and inside that are a couple labels and a textfield. I've set the class type in the xib to be SettingsTableCell and the File's Owner of the xib to my table controller. My SettingsTableController has an IBOutlet property named tableCell. My cellForRowAtIndexPath contains the following code to load my table view xib and assign it to my table controller's tableCell property: static NSString *CellIdentifier = @"CellSettings"; SettingsTableCell *cell = (SettingsTableCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { [[NSBundle mainBundle] loadNibNamed:@"SettingsTableCell" owner:self options:nil]; cell = self.tableCell; self.tableCell = nil; NSLog(@"cell=%@", cell); } This is what my xib set up looks like in IB: When I run my app, the table displays as if all of the cells are standard Default style cells though: The seriously weird part is though... if I tap on the area of the cell where the textfield SHOULD be, the keyboard does come up! The textfield isn't visible, there's no cursor or anything like that... but it does respond. The visible UILabel is obviously not the UILabel from my xib though because the label in my xib is right justified and the one showing in the app is left justified. I'm incredibly confused about how this is happening. Any help is appreciated.

    Read the article

  • Core Data and iTunes File Sharing - Move/hide the .sqlite file on app update?

    - by Eric
    I have an iPad app that uses Core Data for data storage. I would like to enable file sharing in iTunes and I don't really want the users to be able to delete or modify the .sqlite file. Can I move the file to a different, hidden directory? Alternatively, could the file be made read-only? I wouldn't mind users having access to the file as long as it couldn't be changed. I suspect there is a trivial solution that is escaping me at the moment.

    Read the article

  • Trouble setting FIrst view controller which will appear on App Startup

    - by Matte.Car
    I'm setting setting FIrst view controller which will appear on my App Startup. It should appear an UIView first time as a tutorial and, from second time, another standard view. In AppDelegate I wrote this: #import "AppDelegate.h" #import "TabBarController.h" #import "TutorialController.h" @implementation AppDelegate TabBarController * viewControllerStandard; // standard view TutorialController * viewControllerFirst; // tutorial view @synthesize window; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { if ([@"1" isEqualToString:[[NSUserDefaults standardUserDefaults] objectForKey:@"Startup"]]) { window.rootViewController = viewControllerStandard; } else { window.rootViewController = viewControllerFirst; } [window makeKeyAndVisible]; return YES; } It doesn't return any alert but, launching app, after splashscreen, it appear only a black screen. Without that codes everything works fine. What could be wrong? Thank you!

    Read the article

  • ivar is inside two blocks

    - by Desperate Developer
    I have an ivar like this declared on interface: BOOL controllerOK; I have to use this ivar inside a block that resides itself in a block. Something like myBlockl = ^(){ [self presentViewController:controller animated:YES completion:^(){ if (controllerOK) [self doStuff]; }]; }; If I try to do that, I see an error capturing self strongly in this block is likely to lead to a retain cycle for the if (controllerOK) line. This does not appear to be one of those blocks problems that you create another variable using __unsafe_unretained before the block starts. First because this instruction cannot be used with a BOOL and second because the ivar controllerOK has to be tested on runtime inside the block. Another problem is that the block itself is declared on the interface, so it will be used outside the context where it is being created. How do I solve that?

    Read the article

  • UIPickerview filter list from a user previous textfield input

    - by user1547180
    int variabla; - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { return 1; } - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { if (variabla == 1) return list4.count; else if(variabla == 2) return list3.count; if (variabla == 3) return list1.count; if (variabla == 4) return list2.count; return YES; [pickerView reloadAllComponents]; } - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { if (variabla == 1) { subjectField.text = [list4 objectAtIndex:row]; } else if (variabla == 2) { gradeField.text = [list3 objectAtIndex:row]; } else if (variabla == 3) { mathField.text = [list1 objectAtIndex:[pickerView selectedRowInComponent:0]]; selectedRow = [pickerView selectedRowInComponent:0]; coreTView.text = [mathMeaning objectAtIndex:selectedRow]; } if (variabla == 4) { elaField.text = [list2 objectAtIndex:[pickerView selectedRowInComponent:0]]; selectedRow = [pickerView selectedRowInComponent:0]; coreTView.text = [elaMeaning objectAtIndex:selectedRow]; } [pickerView reloadAllComponents]; NSLog(@"row selected is %d", selectedRow); } - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { if (variabla == 1) return [list4 objectAtIndex:row]; if (variabla == 2) return [list3 objectAtIndex:row]; if (variabla == 3) return [list1 objectAtIndex:row]; if (variabla == 4) return [list2 objectAtIndex:row]; return NO; [pickerView reloadAllComponents]; } Hey I would like to know or pointed in the right direction on how to load a UIPickerView based on the user input from a previous uitextfield so if they type in the previous textfield apple I would like red, green, blue to show in the UIPickerView or if they type orange I would like to see orange, yellow grape thanks for the help in advance.

    Read the article

  • Creating UIButton using helper method

    - by ddawber
    I have a subclass of UITableView and in it I want to generate number of labels that share the same properties (font, textColor, backgroundColor, etc.). I decided the easiest way to achieve this would be to create a helper method which creates the label with some common properties set: - (UILabel *)defaultLabelWithFrame:(CGRect)frame { UILabel *label = [[UILabel alloc] initWithFrame:frame]; label.font = [UIFont fontWithName:@"Helvetica" size:14]; label.textColor = [UIColor colorWithWhite:128.0/255.0 alpha:1.0]; label.backgroundColor = [UIColor clearColor]; return label; } I use the method like this: UILabel *someLabel = [self defaultLabelWithFrame:CGRectMake(0,0,100,100)]; [self addSubview:someLabel]; [someLabel release]; My concern here is that when creating the label in the method it is retained, but when I then assign it to someLabel, it is retained again and I have no way of releasing the memory when created in the method. What would be best the best approach here? I fee like I have two options: Create a subclass of UILabel for the default label type. Create an NSMutableArray called defaultLabels and store the labels in this: - (UILabel *)defaultLabelWithFrame:(CGRect)frame { UILabel *label = [[UILabel alloc] initWithFrame:frame]; label.font = [UIFont fontWithName:@"Helvetica" size:14]; label.textColor = [UIColor colorWithWhite:128.0/255.0 alpha:1.0]; label.backgroundColor = [UIColor clearColor]; [defaultLabels addObject:label]; [labels release]; //I can release here return [defaultLabels lastObject]; //I can release defaultLabels when done } I appreciate your thoughts. Cheers.

    Read the article

  • PDF search on the iPhone

    - by pt2ph8
    After two days trying to read annotations from a PDF using Quartz, I've managed to do it and posted my code. Now I'd like to do the same for another frequently asked question: searching PDF documents with Quartz. Same situation as before, this question has been asked many times with almost no practical answers. So I need some pointers first, as I still haven't implemented this myself. What I tried: I tried using CGPDFScannerScan handling the TJ and Tj operators - returns the right text on some PDF, whereas on other documents it returns mostly random letters. Maybe it's related to text encoding? Someone pointed out that text blocks (marked by BT/ET operators) should be handled instead, but I still haven't managed to do so. Anyone managed to extract text from any PDF? After that, searching should be easy by storing all the text in a NSMutableString and using rangeOfString (if there's a better way please let me know). But then how to highlight the result? I know there are a few operators to find the glyph sizes, so I could calculate the resulting rect based on those values, but I've been reading the spec for hours... it's a bloated mess and I'm going insane. Anyone with a practical explanation? Thanks.

    Read the article

  • NSNull isEqualToString Issue With JSON Response

    - by IconicDigital
    I am getting the following error -[NSNull isEqualToString:]: unrecognized selector sent to instance 0x3c168090 on this line of code cell.offerTitle.text = [voucherData objectForKey:@"offer_title"]; Could someone help me correct the problem please? Thanks Oliver * Update ** NSlog [voucherData objectForKey:@"offer_title"] and I get the following 2012-12-05 16:50:17.512 app.co.uk - Vouchers and Deals[6350:907] <null> 2012-12-05 16:50:17.514 app.co.uk - Vouchers and Deals[6350:907] -[NSNull isEqualToString:]: unrecognized selector sent to instance 0x3c168090 Checked the JSON and there was a null value, I have done the following to check if null but this isn't working if([voucherData objectForKey:@"offer_title"] == NULL){ cell.offerTitle.text = @"INVALID"; }else{ cell.offerTitle.text = [voucherData objectForKey:@"offer_title"]; }

    Read the article

  • Why isnt my data persisting with nskeyedarchiver?

    - by aking63
    Im just working on what should be the "finishing touches" of my first iPhone game. For some reason, when I save with NSKeyedArchiver/Unarchiver, the data seems to load once and then gets lost or something. Here's what I've been able to deduce: When I save in this viewController, pop to the previous one, and then push back into this one, the data is saved and prints as I want it to. But when I save in this viewController, then push a new one and pop back into this one, the data is lost. Any idea why this might be happening? Do I have this set up all wrong? I copied it from a book months ago. Here's the methods I use to save and load. - (void) saveGameData { NSLog(@"LS:saveGameData"); // SAVE DATA IMMEDIATELY NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *gameStatePath = [documentsDirectory stringByAppendingPathComponent:@"gameState.dat"]; NSMutableData *gameSave= [NSMutableData data]; NSKeyedArchiver *encoder = [[NSKeyedArchiver alloc] initForWritingWithMutableData:gameSave]; [encoder encodeObject:categoryLockStateArray forKey:kCategoryLockStateArray]; [encoder encodeObject:self.levelsPlist forKey:@"levelsPlist"]; [encoder finishEncoding]; [gameSave writeToFile:gameStatePath atomically:YES]; NSLog(@"encoded catLockState:%@",categoryLockStateArray); } - (void) loadGameData { NSLog(@"loadGameData"); // If there is a saved file, perform the load NSMutableData *gameData = [NSData dataWithContentsOfFile:[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:@"gameState.dat"]]; // LOAD GAME DATA if (gameData) { NSLog(@"-Loaded Game Data-"); NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:gameData]; self.levelsPlist = [unarchiver decodeObjectForKey:@"levelsPlist"]; categoryLockStateArray = [unarchiver decodeObjectForKey:kCategoryLockStateArray]; NSLog(@"decoded catLockState:%@",categoryLockStateArray); } // CREATE GAME DATA else { NSLog(@"-Created Game Data-"); self.levelsPlist = [[NSMutableDictionary alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:kLevelsPlist ofType:@"plist"]]; } if (!categoryLockStateArray) { NSLog(@"-Created categoryLockStateArray-"); categoryLockStateArray = [[NSMutableArray alloc] initWithCapacity:[[self.levelsPlist allKeys] count]]; for (int i=0; i<[[self.levelsPlist allKeys] count]; i++) { [categoryLockStateArray insertObject:[NSNumber numberWithBool:FALSE] atIndex:i]; } } // set the properties of the categories self.categoryNames = [self.levelsPlist allKeys]; NUM_CATEGORIES = [self.categoryNames count]; thisCatCopy = [[NSMutableDictionary alloc] initWithDictionary:[[levelsPlist objectForKey:[self.categoryNames objectAtIndex:pageControl.currentPage]] mutableCopy]]; NUM_FINISHED = [[thisCatCopy objectForKey:kNumLevelsBeatenInCategory] intValue]; }

    Read the article

  • How to resize the UIView when CGAffineTransformIdentity

    - by Gowtham
    I am doing an app which has a feature to rotate and re size a view. i have implemented this feature but i do face an issue. My problem The View wil be resized when dragging its four corners, after resizing it i can rotate the view in both directions. Once the rotation is done, if i try again to resize the view by dragging its corner, the view's size gone to unpredictable value and its moving all around the screen. I googled lot finally i got the following solution The frame property is undefined when transform != CGAffineTransformIdentity, as per the docs on UIView I saw one app which has implemented the feature exactly what i wish to implement. How can i resize the UIView after rotation of UIView My code for resize the view Touches Began - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [[event allTouches] anyObject]; NSLog(@"[touch view]:::%@",[touch view]); touchStart = [[touches anyObject] locationInView:testVw]; isResizingLR = (testVw.bounds.size.width - touchStart.x < kResizeThumbSize && testVw.bounds.size.height - touchStart.y < kResizeThumbSize); isResizingUL = (touchStart.x <kResizeThumbSize && touchStart.y <kResizeThumbSize); isResizingUR = (testVw.bounds.size.width-touchStart.x < kResizeThumbSize && touchStart.y<kResizeThumbSize); isResizingLL = (touchStart.x <kResizeThumbSize && testVw.bounds.size.height -touchStart.y <kResizeThumbSize); } Touches Moved - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ CGPoint touchPoint = [[touches anyObject] locationInView:testVw]; CGPoint previous=[[touches anyObject]previousLocationInView:testVw]; float deltaWidth = touchPoint.x-previous.x; float deltaHeight = touchPoint.y-previous.y; NSLog(@"CVTM:%@",NSStringFromCGRect(testVw.frame)); if (isResizingLR) { testVw.frame = CGRectMake(testVw.frame.origin.x, testVw.frame.origin.y,touchPoint.x + deltaWidth, touchPoint.y + deltaWidth); } if (isResizingUL) { testVw.frame = CGRectMake(testVw.frame.origin.x + deltaWidth, testVw.frame.origin.y + deltaHeight, testVw.frame.size.width - deltaWidth, testVw.frame.size.height - deltaHeight); } if (isResizingUR) { testVw.frame = CGRectMake(testVw.frame.origin.x ,testVw.frame.origin.y + deltaHeight, testVw.frame.size.width + deltaWidth, testVw.frame.size.height - deltaHeight); } if (isResizingLL) { testVw.frame = CGRectMake(testVw.frame.origin.x + deltaWidth ,testVw.frame.origin.y , testVw.frame.size.width - deltaWidth, testVw.frame.size.height + deltaHeight); } if (!isResizingUL && !isResizingLR && !isResizingUR && !isResizingLL) { testVw.center = CGPointMake(testVw.center.x + touchPoint.x - touchStart.x,testVw.center.y + touchPoint.y - touchStart.y); } }

    Read the article

  • UIView animation does not animate at first try?

    - by Bacalso Vincent
    Considering that my _palette's frame is like this: _palette.frame = CGRectMake(0,480,320,200); I have this code here to slide up/down a UIView: if(![_pallete superview]) { [self.view addSubview:_pallete]; [self.view insertSubview:_tempViewPaletteListener belowSubview:_pallete]; [UIView animateWithDuration:0.3 animations:^{ _pallete.top -= kPaletteHeight; } completion:^(BOOL isFinished) { }]; } else { [UIView animateWithDuration:0.3 animations:^{ _pallete.top += kPaletteHeight; } completion:^(BOOL isFinished) { [_tempViewPaletteListener removeFromSuperview]; [_pallete removeFromSuperview]; }]; } *the _tempViewPaletteListener is just a view with a tap gesture use to dismiss the palette* The problem is when I first try to run code here, the _palette view will just stiffly display right away. What I expected is, it should slide up the _palette view. Though it works fine after the first try

    Read the article

  • Cannot access NSDictionary

    - by michael blaize
    I created a JSON using a PHP script. I am reading the JSON and can see that the data has been correctly read. However, when it comes to access the objects I get unrecognized selector sent to instance... Cannot seem to find why that is after too many hours !!!! Any help would be great ! My code looks like that: `NSDictionary *json = [[NSDictionary alloc] init]; json = [NSJSONSerialization JSONObjectWithData:receivedData options:kNilOptions error:&error]; NSLog(@"raw json = %@,%@",json,error); NSMutableArray *name = [[NSMutableArray alloc] init]; [name addObjectsFromArray: [json objectForKey:@"name"]];` The code crashes when reaching the last line above. The output like this: raw json = ( { category = vacancies; link = "http://blablabla.com"; name = "name 111111"; tagline = "tagline 111111"; }, { category = vacancies; link = "http://blobloblo.com"; name = "name 222222222"; tagline = "tagline 222222222"; } ),(null) 2012-06-23 21:46:57.539 Wind expert[4302:15203] -[__NSCFArray objectForKey:]: unrecognized selector sent to instance 0xdcfb970 HELP !!!

    Read the article

  • Objective - C, fastest way to show sequence of images in UIImageView

    - by Almas Adilbek
    I have hundreds of images, which are frame images of one animation (24 images per second). Each image size is 1024x690. My problem is, I need to make smooth animation iterating each image frame in UIImageView. I know I can use animationImages of UIImageView. But it crashes, because of memory problem. Also, I can use imageView.image = [UIImage imageNamed:@""] that would cache each image, so that the next repeat animation will be smooth. But, caching a lot of images crashed app. Now I use imageView.image = [UIImage imageWithContentsOfFile:@""], which does not crash app, but doesn't make animation so smooth. Maybe there is a better way to make good animation of frame images? Maybe I need to make some preparations, in order to somehow achieve better result. I need your advices. Thank you!

    Read the article

  • Best practice? - Array/Dictionary as a Core Data Entity Attribute

    - by Run Loop
    I am new to Core Data. I have noticed that collection types are not available as attribute types and would like to know what the most efficient way is of storing array/dictionary type data as an attribute (e.g. the elements that make up an address like street, city, etc. does not require a separate entity and is more conveniently stored as a dictionary/array than separate attributes/fields). Thank you.

    Read the article

  • Rendering a CGPDFPage into a UIImage

    - by James Antrobus
    I'm trying to render a CGPDFPage (selected from a CGPDFDocument) into a UIImage to display on a view. I have the following code in MonoTouch which gets me part way there. RectangleF PDFRectangle = new RectangleF(0, 0, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height); public override void ViewDidLoad () { UIGraphics.BeginImageContext(new SizeF(PDFRectangle.Width, PDFRectangle.Height)); CGContext context = UIGraphics.GetCurrentContext(); context.SaveState(); CGPDFDocument pdfDoc = CGPDFDocument.FromFile("test.pdf"); CGPDFPage pdfPage = pdfDoc.GetPage(1); context.DrawPDFPage(pdfPage); UIImage testImage = UIGraphics.GetImageFromCurrentImageContext(); pdfDoc.Dispose(); context.RestoreState(); UIImageView imageView = new UIImageView(testImage); UIGraphics.EndImageContext(); View.AddSubview(imageView); } A section of the CGPDFPage is displayed but rotated back-to-front and upside down. My question is, how do I select the full pdf page and flip it round to display correctly. I have seen a few examples using ScaleCTM and TranslateCTM but couldn't seem to get them working. Any examples in ObjectiveC are fine, I'll take all the help I can get :) Thanks

    Read the article

  • How Do I Bind a UIButton Property to Another Property?

    - by cygnl7
    UIButton eventually inherits from NSObject, and NSObject implements NSKeyValueBindingCreation Protocol. So why can't I bind a UIButton's property to another class' property? [myUIButton bind:@"enabled" toObject:myOtherObject withKeyPath:@"otherObjectBOOLProperty" options:nil]; This results in the warning 'UIButton' may not respond to '-bind:toObject:withKeyPath:options:' What I'm trying to do is bind the enabled state of my UIButton to myOtherObject.otherObjectBOOLProperty.

    Read the article

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