spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » IOS » Page 20
Core Data - Insert based by parameter
Well, CoreData doesn't have the logic of Primary key built in. Actually CoreData manage graph of objects that can be persisted,it's not strictly speaking an ORM. So, you will have to make a request (using NSFetchRequest) to fetch objects with firstname Josh, if there is none you will add it, else you can update it. It's possible to build security in your code to enforce that unicity rule with va

Categories : IOS

SceneKit how to draw a sphere showing mesh like surface instead of smooth?
Your wish #1: "not smooth" sphere Your wish #2: wireframe Past this into Xcode playground: import Cocoa import SceneKit import QuartzCore import XCPlayground // create a scene var sceneView = SCNView(frame: CGRect(x: 0, y: 0, width: 300, height: 300)) var scene = SCNScene() sceneView.scene = scene XCPShowView("The Scene View", sceneView) sceneView.autoenablesDefaultLighting = false // creat

Categories : IOS

DynamicCastClassUnconditional with Custom Cell Class
You need to register your custom cell class with the table view for that reuse identifier. In your view controller's viewDidLoad, add the following: class SettingsEndpointCreateViewController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() tableView.registerClass(TextCell.self, forCellReuseIdentifier: "EndPointName") } // ... } Also, note

Categories : IOS

A Framework of subclasses
You can supply a static library (.a) and the public headers... which is sort of what a mac Framework is (that uses a dynamic library, but it is a library with headers.) ... MainView.h @interface MainView : UIView -(void) someMethods; @property int someProperty; @end then just supply them with a compiled version of MainView.o probably packaged as yourlib.a and that header... They will just imp

Categories : IOS

How can I guarantee unique entries in a Core Data store in a shared app container used by both the host app and an extension?
It seems like the simplest approach to this would be to simply avoid the multiple writers in the first place. Why not just drive your extensions entirely off cached data, and then only update your data store from your primary iOS app?

Categories : IOS

Register for remote notifications in navigation controller
If I understand correctly, it seems like you want to show a view whenever your app receives a remote notification and you want to be able to display the view from anywhere inside the app. If this is correct, the best approach would be to create a new UIWindow object and display that as an overlay on top of your app's main window. This answer describes how to create a UIWindow and display it. Addit

Categories : IOS

Implement button dragging with momentum?
If you have to support iOS 6 You can animate change to the button's center when pan gesture ends: if(panGestureRecognizer.state == UIGestureRecognizerStatedEnded) { finalVelocty.x = velocity.x; finalyVelocity.y = velocity.y; NSTimeInterval animationTime = 0.25; //adjust the time to your needs [UIView animateWithDuration:0.25 animations:^{ button.center = ... // calculate bu

Categories : IOS

String does not conform to type AnyObject in NSarray Swift
NSArray can only hold reference types, whereas Swift's String is a value type. String instances are normally automatically bridged to NSString, but the constructor you're using for the NSArray explicitly expects AnyObject, so that kind of bridging is defeated. You should be able to use a Swift Array instead: Exersice (name: "Test", type: "Test", muscles: ["muscle1", "muscle2"], ...

Categories : IOS

What is the best way to sync two devices heartbeat on iOS?
I think the right way is Device A sends information to Device B (without timestamp) Device B responses to Device A timestamp of reception. Device A receives the timestamp of data delivery. In this case both Device A and Device B will receive same timestamp of data sharing.

Categories : IOS

Xcode6 - Swift: How to detect which object is touched and move/drag/drop?
Use a UITouchGestureRecognizer. You can create a general one which uses a delegate call to handle the touch. You can then add this to any views you create programatically or in a viewDidLoad type methop you can attach it there.

Categories : IOS

Animating UIView and Mask
try to use 2 UIViews, just maskView should be bring to front: [superview bringSubviewToFront:maskView]; and set background color and alpha property for mask view, maskView.backgroundColor = [UIColor blackColor]; maskView.alpha = 0.8; and now you can move 2 view directly. but better is to add 2 view to other view - container, and rotate this one view.

Categories : IOS

How to dynamically set image in iOS
Observe the line [(UIImageView *)[cell viewWithTag:201] setImage:[arrayImages[indexPath.row]];. Here you just use the image name. Where as you have to pass UIImage object here. Replace it with below line [(UIImageView *)[cell viewWithTag:201] setImage:[UIImage imageNamed:arrayImages[indexPath.row]]];

Categories : IOS

use large app icon from older version in iTunes connect
Some months ago (many months, in reality), iTunes Connect required a "large" 512x512 app icon. Now they require a 1024x1024 icon. My suggestion, in case you don't have access to the vectorial graphic or cannot generate again, is trying to up-sample the icon. I would try Photoshop or another image editor that has options to upscale with corrections.

Categories : IOS

Implementing pre-roll video iAds
Check my example for a working implementation of iAd's prerolled video ads: #import "ViewController.h" @import iAd; @import MediaPlayer; @interface ViewController () { MPMoviePlayerController *moviePlayer; } @end @implementation ViewController -(void)viewDidLoad { [super viewDidLoad]; // Preload ad [MPMoviePlayerController preparePrerollAds]; // Create our MPMoviePlayerC

Categories : IOS

video.js: autoclick on play button (to get around iOS autoplay limitation)
Unfortunately no. Apple has blocked every possibility of doing this that I'm aware of. It's meant to protect iPhone users with expensive mobile data plans from downloading video data that they didn't intend to. It would be nice if autoplay could still work when the user was on wifi, or even if there was a user setting to allow autoplay, but there's nothing like that yet.

Categories : IOS

Swift segue from CollectionViewCell failing to display new view
For anyone with similar problems, I solved this by manually triggering the segue using the didSelectItemAtIndexPath method. I don't think I should have had to do this, but perhaps I misunderstood. Either that or it's a bug. The method I added to CollectionViewController in the end looks like this: func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSInde

Categories : IOS

How can I take a snapshot of a view that is out of the visible bounds?
Try something like this – any better? UIGraphicsBeginImageContext(yourSubview.frame.size); CGContextRef context = UIGraphicsGetCurrentContext(); [[yourSubview layer] renderInContext: context]; UIImage *screenShot = UIGraphicsGetImageFromCurrentImageContext();

Categories : IOS

Using the HTML5
As Matt Gibson wrote, you may want to brush up on HTML video and audio. Some places to start: Mozilla Developer Network - Using HTML5 audio and video Safari Developer Library - iOS Specific Considerations (My rep isn't high enough to post more than two links, but do a Google search for "HTML Video Tag" for more.) As for your code: there are a few things going on here that you will want to chan

Categories : IOS

RemoteDesktopProtocol In IOS
Just use FreeRDP Here is readme for iOS part

Categories : IOS

Simulate device buttons inside my app?
None of these functions are available to you if you want to get your app accepted into the App Store. For a while some apps accessed private API's in AVSystemController however it seems recently apps using this method are being rejected. (Although some apps still using the method seem to be left in the app store) If you want to go down the jailbreak route you'll have to dig into private API's and

Categories : IOS

UIBarButtonItem clickable on left but not on right of navigation controller
If something doesn't want to react appropriately to touches, often the problem is that one of the parent view's frames has incorrect size, which doesn't fully cover the child's frame. You could check them, for example, by printing out view hierarchy in gdb: po [[UIWindow keyWindow] recursiveDescription]

Categories : IOS

+[UIPasteboard _accessibilityUseQuickSpeakPasteBoard]: unrecognized selector sent to class
This problem appears because TapJoy has used categories in static library (that's UIPasteboard_QSExtras) The solution is super simple, you need to notify linker about that 1) Click on the project 2) Click on the target 3) Open Build Settings tab 4) Search for Other Linker Flags 5) Double click on Other Linker Flags 6) Add -ObjC and -all_load flags 7) Remove binary (delete from device/si

Categories : IOS

Handling TouchID Authentication for Login using Database in IOS
You should store in the keychain TouchID-protected username and password. Then when you need authenticate user, just ask keychain for that data. IOS will automatically ask user to use his finger.If authentication was successful you will get yours username and password.

Categories : IOS

How to reliablly detect that a UIViewController has been dismissed
When using a UINavigationController it is available through the NavigationController property on the UIViewController (or equivalent) subclass object. The ViewWillDisappear(bool animated) and ViewDidDisappear(bool animated) will be called when a new UIViewController is loaded onto the UINavigationController stack. It may help if you utilise the storyboard functionality within Xamarin Studio as

Categories : IOS

iOS app - data across devices
There are a lot of different approaches to this and it will depending on the kind of data and what kinds of devices you want to target. I would suggest using CoreData for your local data and using Parse.com for your backend. Your app would push/pull data to Parse to sync the data.

Categories : IOS

transition between is and iOS 8 using NSString imageURL
I think the following code would help you, int row = [indexPath row]; cell.TitleLabel.text = _Title[row]; cell.DescLabel.text = _Description[row]; NSString *stringUrl = _Images[row]; NSURL *urlStr = [NSURL URLWithString:stringUrl]; ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; [library assetForURL:urlStr resultBlock:^(ALAsset *asset) {

Categories : IOS

Setting "Build Active Architectures Only" To "YES" Pros vs Cons?
Yes, I don't think Apple will let you submit the app that way, but if you distribute it in other ways, it won't work on older devices... That's why it's usually set as YES for Debug and NO for Release

Categories : IOS

How does Urban Airship gets a push token without implementing application:didRegisterForRemoteNotificationsWithDeviceToken:
Figured it out. All you need to do is to create a class that inherits from UIResponder, and the conforms to UIApplicationDelegate protocol. At run time, you will need to: [[UIApplication sharedApplication] setDelegate:someNewDelegate]; and to foreword the calls to the old delegate (so keep a pointer to it). ** EDIT ** There is also the option of Swizzling. have a look: http://nshipster.com

Categories : IOS

How to manage Core Data to fulfill appropriate section?
This not how it is done. You are trying to solve problems that have already been solved for you. Instead, you should use a NSFetchedResultsController to populate a table view with Core Data. Create a new project (e.g. Master-Detail) and check the "Core Data" option to see how this is done. You can copy paste the fetched results controller code into your app without many modifications.

Categories : IOS

appending rows to tableView from within a block
First, ensure that searchResultBlock gets executed on the main thread as @mbo42 mentioned. Second, wrap rows insertions in beginUpdates / endUpdates: [weakSelf.tableView beginUpdates]; NSUInteger currentTipCount=weakSelf.tips.count; [weakSelf.tips addObjectsFromArray:tips]; // adding data to datasource. NSMutableArray *indexPaths = [NSMutableArray array]; for (NSUInteger i = 0; i < tips.count

Categories : IOS

How to sort UITableView sections
Once you've finished loading the dictionary with all the values, you'll want to sort each array within the dictionary... for (NSString *key in [preResult allKeys]) { NSMutableArray *mArray = [preResult objectForKey:key]; // sort array to achieve the desired result NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"formattedDate" ascending:YES]; NSArray *s

Categories : IOS

UITapGestureRecogniser in GMSMapView
I managed to do it with func mapView(mapView: GMSMapView!, didTapAtCoordinate coordinate: CLLocationCoordinate2D) { println("It works") } But if someone could explain to me why the other solution didn't work, it would be great!

Categories : IOS

UIDevice has phone capability? iOS8 (can make phone call)
On iOS 8, it's better to check if your device is iPad or iPod Touch, because with hands off, all device device return YES (simulator return NO) on this test. Hope Apple correct this in future. That's block hands off capabilities but that work.

Categories : IOS

Alamofire with append won't show data
Alamofire does everything asynchronously. Instead of having getDataByJson return an array of strings, have it accept an additional completionHandler parameter that executes with the response data when the request finishes.

Categories : IOS

Ios 7 speed dial cell style
You can use UIButton/UIImageView according to your requirement. To make that component as circle you should set corner radius. object.layer.cornerRadius = 40; object.clipsToBounds = YES;

Categories : IOS

Tabbar's viewcontroller gets reload while changing the orientation, in iOS 8
I had the same problem. I noticed that on iOS8 when the orientation of the device is changing viewWillTransitionToSize:withTransitionCoordinator: is getting called on UITabBarController, and UITabBarController calls viewDidLoad method of any viewcontroller that has not been loaded yet. For now,in my UITabBarController subclass I override this method to not call [super viewWillTransitionToSize:siz

Categories : IOS

How to add more than 6 segments with image on iphone using uisegmentcontrol
I try with same code and it work Output: Code: UIImage* resetImage = [UIImage imageNamed:@"Image"]; UIImage* wlwwImage = [UIImage imageNamed:@"Image"]; UIImage* huImage = [UIImage imageNamed:@"Image"]; UIImage* panImage = [UIImage imageNamed:@"Image"]; UIImage* disImage = [UIImage imageNamed:@"Image"]; UIImage* areaImage = [UIImage imageNamed:@"Image"]; UIImage* clr

Categories : IOS

How to open my iPhone App from Email?
I think you might need to setup a custom uniform type identifier (UTI). Take a look at this solution. I believe this is the answer you are looking for. Also, it might be necessary to look at the Apple documentation for NSKeyedArchiver, which is the key to custom file types. You'll be able to read and write files to/from a certain directory using this.

Categories : IOS

Restyle whole App UI on event - What is the best approach?
Did a quick Google search and found this: // Update UIAppearance... NSArray *windows = [UIApplication sharedApplication].windows; for (UIWindow *window in windows) { for (UIView *view in window.subviews) { [view removeFromSuperview]; [window addSubview:view]; } } ... from http://snipplr.com/view/75259/refresh-uiappearance-after-application-loaded/ It quite effectively

Categories : IOS


Recently Add
keychain iOS touchId prompted twice
-[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x7fc748e37ea0'
Search Results Visibly Scrolling Underneath the Status Bar
How do I exclude an IOS 8 app extension from a build?
EXC_BAD_ACCESS when capturing a GPU frame
iOS 8 - Map keeps reanimating back to user location
Constantly refreshing background image of UIImageView IOS
UINavigationController keeps displaying popped view
Swift closure syntax using Shark Food Mute Switch?
MagicalRecord 3.0 not saving. No objects for the second build
iOS / Swift Can't add gesture to child class
iOS: Is there currently a way to prevent two view controllers being pushed or popped at the same time?
Checking if array contains two objects
How should turning of SCNLight affect background color?
Why don't my views show up in Storyboards and are greyed out in the left pane?
SWIFT convert NSTimeInteval to NSDate
BLE scanning is stopped when go to background?
Drawing a Rect on UIView
HLS playback via local HTTP server on iOS
Re-Assigning SKScene delegate protocol
Network lost on screen lock unlock
Annoying Xcode Error "file not found" #import
CoreData not firing faults
iOS:How do you change a view size/origin from another view controller class?
Changing a frame in viewDidLayoutSubviews
Animate multiple shapes in UIView
Add NSIntegers ONLY when 2nd NSInteger Changes Value
Facebook SDK, fetching friends
How to get Storyboard to support dynamically sized cells in UICollectionView?
GCD / NSOperationQueue EXC_BAD_ACCESS
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.