spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » IOS » Page 1
Pass Data Between Two View Controllers When Using a Tab Controller Layout
The UITabBarController has a delegate, which has a method tabBarController:didSelectViewController: you can use that to accomplish what you're looking for. Apple's documentation can be found here

Categories : IOS

Trigger textFieldShouldClear programmatically
TextField delegate methods will not fire if you set the text programmatically. Related Question You can probably just perform whatever logic needs to be done after your textField.text = @""; line though, right?

Categories : IOS

iOS8: Blue bar "is Using Your Location" appears shortly after exiting app
This is not a bug, you still have an active location manager somewhere in you app. Do you have a map view with showsUserLocation = YES for example? That could be it. I went over my project thoroughly and when i stopped all location managers the bar disappeared when it should.

Categories : IOS

XCode dislpaying JSON issues
Add option to your request and encoding to your data NSData * data = [getcatDataURL dataUsingEncoding:NSUTF8StringEncoding]; jsoncatarray = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];

Categories : IOS

Multiple NSHTTPCookieStorage in the same app
I am trying to achieve the same thing. The ephemeralSessionConfiguration doesn't store your cookies, because its cookieAcceptPolicy is always set to NEVER, even if you try to change it to something else. Same goes for the manually allocated NSURLSessionConfiguration. From my point of view this is in contrast to the documentation which states that ephemeral sessions use an in-memory cookie store.

Categories : IOS

how to make one items position equal to another items height in interface builder using autolayout?
Press Option (alt) and drag from one view to another view . You have to select "Equal Heights"... and then change the mutlipier to 0.25 as you mentioned in the question.

Categories : IOS

CoreData class miss match in unit test
In Swift you have to specify the Type of the array resulting from a fetch request. The if let pattern requires an optional cast. if let result = moc.executeFetchRequest(request, error:&e) as? [Boss] { // use result }

Categories : IOS

Gesture recogniser in different class?
Try UITapGestureRecognizer Apple Docs on UITapGestureRecognizer

Categories : IOS

How to resign an app with app store provisioning profile to add beta-reports-active key?
You could always try using the xcodebuild export command: xcodebuild -exportArchive -archivePath '{APP}' -exportPath '{IPA}' -exportFormat 'ipa' -exportWithOriginalSigningIdentity or if you want a different profile and identity: xcodebuild -exportArchive -archivePath '{APP}' -exportPath '{IPA}' -exportFormat 'ipa' -exportWithOriginalSigningIdentity -exportProvisioningProfile {profilename} -

Categories : IOS

Add subview outside viewDidLoad Objective-c
Do you call it before [super viewDidLoad]? Use [label setBackGroundColor:[UIColor blueColor]] to be sure the label isn't added. Try [label sizeToFit] because maybe there is a problem with numberOfLines = 4;

Categories : IOS

Image Picker in SKScene
I'm not quite sure what you're trying to do here, however do you want to get a picture from camera roll and make it the background? @interface ViewController : UIViewController <UINavigationControllerDelegate,UIImagePickerControllerDelegate> { IBOutlet UIImageView *ImageView; UIImagePickerController *picker; UIImage *image; } //.m file -(IBAction)TakePhoto:(id)sender { picker = [[UIImag

Categories : IOS

Dynamic UITableViewCell's height in iOS 7 AND iOS 8 impossible
In the end I found an acceptable solution, which doesn't mess up layout code to much. In short: In table view cell's updateConstraints I removed the constraint from _summaryView-bottom to superview-bottom. So height constraints on the content view do not interfere with the ones from summary view. - (void)updateConstraints { NSDictionary *views = NSDictionaryOfVariableBindings(_summaryView);

Categories : IOS

Switch in Swift - Case label in a switch should have at least one executable statement
There is no implicit fallthrough in the swift switch statement, so you have to explicitly set that: case .CameraICloudActivated: fallthrough case .CameraICloudShare: fallthrough case .CameraMyPhotoStream: fallthrough case .CameraPhotosCount: fallthrough case .NetworkConnection: fallthrough case .PhoneLanguage: fallthrough case .UserIdentifier: return value Wi

Categories : IOS

Manually bounce UIScrollView
From my understanding, you want to enable bouncing when you get to the edge of a scroll view. If you want the default of the scrollview to be that it doesn't bounce, then use this code: override func viewDidLoad() { super.viewDidLoad() self.scrollview.bounces = false } Then, if you want to enable bouncing at any point, just add the line: self.scrollview.bounces = true If you know th

Categories : IOS

Can I mix and match programmatic adding of views and use a storyboard at the same time for iOS?
You should structure your Views properly in Interface Builder, you can use constraints to do so. Of course you can add views programmatically as well. Remember that Interface Builder does nothing else then defining a file which stores the structure of your interface to load it from nib. So you just need to add your views programmatically using addSubview methods and add your constraints just the s

Categories : IOS

Symbol Not Found in Xcode when clicking a type like UIWindow, and no code hint anymore
It happens sometimes because of corrupted delivered data. Go to Xcode->Preferences->Locations, then click on the little arrow to locate the folder of "Delivered data" in Finder. Delete all contents in that folder, then restart Xcode.

Categories : IOS

Simulator's behavior different from the device's?
What I would expect is that the code should behave the same way on both the simulator and the actual device. In general, this is a safe assumption. But differences between the simulator and device are a fact of life with iOS development and it's important to do actual device testing to find these kinds of issues. But I would imagine that you would want to use UIKeyboardFrameEndUserInfoKey in

Categories : IOS

UIImageView outlet is still nil after viewDidLoad only on iOS7
Moving your code to the viewWillAppear will likely fix your issue, but that's not really the optimal solution. What if you add a call to [self.tableView reloadData]; before you set the image to make sure that the tableView is initialized?

Categories : IOS

separator line is not showing properly while setting text to tableviewcell
You need to specify the inset if you want to use full width -(void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; if ([self.tableview respondsToSelector:@selector(setSeparatorInset:)]) { [self.tableview setSeparatorInset:UIEdgeInsetsZero]; } if ([self.tableview respondsToSelector:@selector(setLayoutMargins:)]) { [self.tableview setLayoutMargins:UIEdgeInse

Categories : IOS

Cannot invoke 'subscript' with an argument of type 'NSString'
The object you are trying to apply the subscript is objects, which is an array. You probably want to do that at the i-th element: for var i = 0; i < objects.count; ++i { friendsArrays.append(objects[i]["first_name"] as NSString) // ERROR here ^^^ } However I suggest to convert that into a for-each loop for object in objects { friendsArrays.append(

Categories : IOS

How do you repeat an animation in a swift class
Look at the available signatures for animateWithDuration here. Note that one of them is animateWithDuration(_:delay:options:animations:completion:). Try using .Repeat as the options parameter (a full list of options can be found here). Specifically: UIView.animateWithDuration(0.5, delay: 0, options: .Repeat, { view.layer.transform = CATransform3DIdentity view.layer.opacity =

Categories : IOS

Filling up NSMutableArray
Why don't you do [notificationsArray objectAtIndex:indexPath.row] instead of NSMutableArray *titles = self.notificationsArray; cell.textLabel.text = titles[indexPath.row]; ? If you really dont want, at least do NSMutableArray *titles = [NSMutableArray arrayWithArray:self.notificationsArray]; And in the first piece of code, what are the Console Logs? Are you sure you enter in the for lo

Categories : IOS

How to get NSDate with nil value
timeInterval is an Optional, you need to unwrap it first if let ti = timeInterval { if ti < dayInSeconds { ... } } More on Optionals

Categories : IOS

lexical and preprocessor issues ios on project rename
I've solved the issue. when i changed the name of project name it also changed the prefix of header path that is before the name of project was xyz which i changed to mdot. "$(project_name)/libs/cocos2dx" before this was interpreting as "xyz/libs/cocos2dx" and when changed the name of project it was interpreting as "mdot/libs/cocos2dx" bec the folder name of the project was still xyz i forcefully

Categories : IOS

Dismiss iOS native MPVolumeView audio route menu
on iOS 8, you can use below code which use private API NSArray *windows = [[UIApplication sharedApplication] windows]; for (UIWindow *window in windows) { if ([NSStringFromClass([window class]) isEqualToString:@"_MPAVRoutingSheetSecureWindow"]) { UIView *view = [window.subviews firstObject]; if ([NSStringFromClass([view class]) isEqualToString:@"MPA

Categories : IOS

Creating an RGB CVOpenGLESTexture in iOS
Answering myself, though I will be happy to be proved wrong and shown how to do this. As I show here (answering myself yet again) it is possible to list all the fourCC buffer formats supported on the device, and a bunch of format attributes associated with each such fourCC format. The flags pertinent to this question are: kCVPixelFormatOpenGLESCompatibility kCVPixelFormatContainsAlpha : Sh

Categories : IOS

Rendering multiple polylines on MapView
The main problem is in the second for loop: var fromCoordinateIC :CLLocation = CLLocation(latitude: icRouteLat[j], longitude: icRouteLat[j]) //<-- should be icRouteLong var toCoordinateIC :CLLocation = CLLocation(latitude: icRouteLong[j+1], //<-- should be icRouteLat longitude: icRouteLong[j+1]) The second line is not visible (or not where you expe

Categories : IOS

Convert RLMResults to RLMArray
RLMArray has been split into two classes: RLMArray and RLMResults. RLMArray is now used only for to-many properties on RLMObject classes, while RLMResults is used for all of the querying and sorting methods. This was done to reflect that the two actually had fairly different APIs (for example, RLMResults does not have addObject:), and they’re expected to diverge further as we add

Categories : IOS

Test External Browser launched with KIF in iOS
KIF can't assert what was opened with Safari. It can only do things within your app. If you just want to know that that specific URL was launched, you should probably use a unit test. openURL is an SDK method though so not a lot of value in testing that it does launch. If it fails then Apple needs to release an OS update to fix it so you can't do anything to fix it anyway. Instead, just test

Categories : IOS

Access photos with AssetLibraryPhotosViewer
This is a security feature of the OS that cannot be disabled. If a user does not give your app permission to access the photo library your app will not be able to access any photos. Given this ability your app should be able to handle the situation gracefully from a UI/UX perspective. For more information take a look at this guide from Apple about iOS security guidelines (page 47 takes about acce

Categories : IOS

Is it safe to save persistent data as txt file for CoreData?
A better option would be to keep a "canned" sqlite file in your app bundle and check for the existence of the SQLite file in your documents directory. If the file does not exist, copy the canned data from the app bundle to your documents directory. That will skip the entire parsing logic and will allow your application to launch faster.

Categories : IOS

set the filename after finish download in Swift
I thing what you where looking for is downloadTask.originalRequest.URL.lastPathComponent which gives you the original filename as provided in the URL. func URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didFinishDownloadingToURL location: NSURL) { println("session (session) has finished the download task (downloadTask) of URL (location).") var error : NSError

Categories : IOS

Change content of UICollectionViewCell during interactive transition
This library will help you achieve what you are trying. If you are interested in custom animations I would suggest you use FB pop library

Categories : IOS

iOS Microphone capture LPCM not working for a sample rate of 8 kHz
Well, found out the answer myself. For some obscure reasons, 186 frames reported to be ready by the callback was one too many. After I replaced the value with 185 in the call of AudioUnitRender() it worked like a charm. It seems there is a bug and somethimes CoreAudio reports an extra frame as ready. For higher frequencies the problem did not exist, as the number of frames was always constant an

Categories : IOS

How to make function which takes block as parameter and one boolean and in body if boolean is true executes that block?
Objective-C Method: - (void)executeBlock:(void (^)(void))block onCondition:(BOOL)condition { if (condition) { block(); } } C function: void executeBlock(void (^block)(void), BOOL condition) { if (condition) { block(); } }

Categories : IOS

SWRevealViewController not toggle
I finally managed to solve my problem. According to John Lluch examples, i modified my code. Here is the solution without using storyboards : AppDelegate.h #import <UIKit/UIKit.h> #import "SplashScreenController.h" #import "SWRevealViewController.h" @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (strong, nonato

Categories : IOS

Swiping of Multiple Views in iOS
This tutorial will help you get started, it has multiple views and a persistent view as well. It also has the source code, so you can dive into the code if you don't want to read the tutorial. If you don't want to use UIPageViewController take the UICollectionView approach to simplify things. Take a look at this question for an example.

Categories : IOS

How to make a left/right segue that follows the position of the finger in Xcode
This approach is called sidebar navigation. A lot of examples are available online. At least, you can refer to: http://www.appcoda.com/ios-programming-sidebar-navigation-menu/ or http://www.raywenderlich.com/32054/how-to-create-a-slide-out-navigation-like-facebook-and-path Source code snippet can be taken from: https://github.com/jdehlin/Xamarin-Sidebar Another unusual approach here: https://gi

Categories : IOS

Encode URL contains special characters
AS you said, http://some.com//en/it/name-50%-other-set-50%-/68 is a bad URL. What is the good URL you're supposed to have ? And why is there // after .com?

Categories : IOS


Recently Add
Error: User interaction disabled in lower parts of UIScrollView
Pass Data Between Two View Controllers When Using a Tab Controller Layout
Trigger textFieldShouldClear programmatically
iOS8: Blue bar "is Using Your Location" appears shortly after exiting app
XCode dislpaying JSON issues
Multiple NSHTTPCookieStorage in the same app
how to make one items position equal to another items height in interface builder using autolayout?
CoreData class miss match in unit test
Gesture recogniser in different class?
How to resign an app with app store provisioning profile to add beta-reports-active key?
Add subview outside viewDidLoad Objective-c
Image Picker in SKScene
Dynamic UITableViewCell's height in iOS 7 AND iOS 8 impossible
Switch in Swift - Case label in a switch should have at least one executable statement
Manually bounce UIScrollView
Can I mix and match programmatic adding of views and use a storyboard at the same time for iOS?
Symbol Not Found in Xcode when clicking a type like UIWindow, and no code hint anymore
Simulator's behavior different from the device's?
UIImageView outlet is still nil after viewDidLoad only on iOS7
separator line is not showing properly while setting text to tableviewcell
Cannot invoke 'subscript' with an argument of type 'NSString'
How do you repeat an animation in a swift class
Filling up NSMutableArray
How to get NSDate with nil value
lexical and preprocessor issues ios on project rename
Dismiss iOS native MPVolumeView audio route menu
Creating an RGB CVOpenGLESTexture in iOS
Rendering multiple polylines on MapView
Convert RLMResults to RLMArray
Test External Browser launched with KIF in iOS
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.