This question already has an answer here:

I can't figure out why am I getting this error while submitting for preview in itunesconnect, the error itself is unhelpful.


I have a simple IOS app using Webview to serve local html files within the bundle. Apple are insisting that my external links open in Safari though.

I know this has been asked before but I cannot make sense of any of the answers as I have limited knowledge of IOS. Any help appreciated - here is my current code -

//  ViewController.h

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController <UIWebViewDelegate>
@property (weak, nonatomic) IBOutlet UIWebView *webView; 


//  ViewController.m

#import "ViewController.h"

@interface ViewController ()


@implementation ViewController

- (void)viewDidLoad {

        [super viewDidLoad];
        NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"LocalHTML"];
        NSURL *url = [NSURL fileURLWithPath:htmlFile];
        NSURLRequest *request = [NSURLRequest requestWithURL:url];

        [self.webView loadRequest:request];


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.


Im trying to get two SKshapeNodes to be positioned on the far left and far right of the screen without any part of the nodes offscreen like this I don't want one node to be positioned according to the other node though. Ive been trying to use minX and maxX and use the width of the screen and SKshapeNodes and I can't figure it out.

Any suggestions?

I’m trying to animate specific parts of a SCNScene object in SceneKit (in my case I want to animate fingers of a hand). I import the .dae (COLLADA) file easily from Blender with the respective bones to generate articulation on the model.

override func viewDidLoad() {

    var scene = SCNScene(named: "hand.dae")!
    sceneView.scene = scene
    sceneView.allowsCameraControl = true
    sceneView.autoenablesDefaultLighting = true
    sceneView.backgroundColor = UIColor.lightGrayColor()

My goal is to animate those bones on iOS with user generated values between 0 and 1. Imagine a UISlider where you scroll back and forth and see the specific finger move depending on the value of the slider.

Image with the animation needed

I’ve tried animate the model by calling an animation file like the Apple’s Fox example:

private var indexFingerAnimation: CAAnimation!

indexFingerAnimation = CAAnimation.animationWithSceneNamed(“move_index_finger.dae”)
indexFingerAnimation = false
indexFingerAnimation = 0.3
indexFingerAnimation = 0.3
indexFingerAnimation = Float.infinity

The problem is that’s a Global animation instead of just the index finger. Besides it’s always a ‘pre-defined’ animation instead of an animation controlled by user input. Ultimately I want to mix animations (e.g. move index finger and thumb at the same time revealing gestures)

Is this possible? I’m struggling because I can’t figure out how to manipulate specific parts of the mesh. I’m starting to study MetalKit but it’s not clear to me that’s the solution.

Any help would be really appreciated.

I've 5 pages in my PageViewController. Each page, user enters some details. If the user has not entered all the required details, and he/she tries to swipe. I show an alert saying "Please enter all the required details."

But if the alert once shows, I block the page change by making the GetPreviousViewController or GetNextViewController return null. Then I try to swipe again, nothing happens, even if user has entered all the required details. I'm getting a bounce effect like its the last page.

public class ProgramSettingsPageDataSource : UIPageViewControllerDataSource
    List<string> pages;
    ProgramSettingsController parentController;

    public ProgramSettingsPageDataSource(List<string> pages, ProgramSettingsController vC)
        this.pages = pages;
        parentController = vC;

    override public UIViewController GetPreviousViewController(UIPageViewController pageViewController, UIViewController referenceViewController)
        var index = pages.IndexOf(referenceViewController.RestorationIdentifier);
        if (index > 0)
            if (parentController.CanChangePage())
                parentController.currentPageIndex = index - 1;
                return parentController.ViewControllerAtIndex(index - 1);
        return null;

    override public UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController)
        var index = pages.IndexOf(referenceViewController.RestorationIdentifier);
        if (index < pages.Count - 1)
            if (parentController.CanChangePage())
                parentController.currentPageIndex = index + 1;
                return parentController.ViewControllerAtIndex(index + 1);
        return null;


I think it's because once the GetPreviousViewController or GetNextViewController return null. It thinks its the last page. How do I handle this situation. Any help is appreciated...

public void CanChangePage()
    if (some condition is met)
        new UIAlertView("Error", "Please enter all the required details.", null, "OK", null).Show();
        return false;
    return true;

I have an applescript

do shell script "echo -n -e \\\\x61\\\\x61\\\\x61 > /tmp/file.txt"

But the file.txt does not contain "aaa"!

It contains "-n -e aaa\n" instead.

Can someone help me with that problem?

Is it possible to achieve this use case in Akka:

  1. Command is received in central Actor and we emit 10 events
  2. Actors are receiving events and process them (some Actors just buffer the events)
  3. When all actors finished working central Actor is asking other actors - anything else to process?
  4. All Actors that were buffering events starts processing them and publishing new events
  5. When all actors finished working central Actor is asking other actors - anything else to process?
  6. At this point all actors say nothing more to process - so the unit of work is done.

I'm trying to learn the language Inform 7 and its very odd programming model.

Unfortunately I'm finding it hard to get my head around it because the language reads so much like natural English. I can't seem to intuitively understand what natural English statements are and aren't valid statements within the grammar.

Has anyone presented the Inform 7 grammar in ENBF form? I think that might make it a lot easier for me to understand.

I've got some code that's searching pixel by pixel from a starting point, at a certain angle, until it finds a pixel (a non-white pixel)

It only has to search around 300 pixels: I'm currently using polar to Cartesian function 300 times...

def pol2cart(rotdist, cwangle):
    x = rotdist * numpy.cos(cwangle)
    y = rotdist * numpy.sin(cwangle)
    return(x, y)

... but it's very slow, up to 68 milliseconds per search (if it goes the whole 300 without finding anything) and I've got quite a lot of these searches to do... which is the main cause of my overall function taking about 20 seconds to run (I'd be happy with <2 seconds)

My theory is: if I can create a list of coordinates that describe a line from the centre point to the 300px distance end point, I only need to run pol2cart once (go get the end point) and then I can just iterate over my "line list"...

So I guess I could do something like (psuedo):

If line == UppyDowny:
    for Y in line:
        Solve X 

elseIf line == LeftyRighty:
    for X in line:
        Solve Y 


... that should be a lot faster than 600 cos/sin calls. But does anyone know of an existing function that achieves that?

These days I'm learning CSS by reading specifications, but I noticed W3C marked CSS Basic Box Model Level 3 as "Dangerously outdated" without any further explanation.

enter image description here

So my question:

  1. What's the reason for considering that specification outdated?
  2. Why CSS3 Box Model is Outdated but CSS2.1 box model is not outdated(because they said "see CSS 2.1")?

One of the important concepts in Object Oriented Programming is Encapsulation. However, lately the software world seems to be tilting in favour of other paradigms like functional programming.

It makes me think, what about encapsulation and other OOP tenets? Are they wrong?

Is it that OOP is applied wrong? For instance Alan Kay is noted for saying in the OOPSLA'97 Keynote: "I invented the term object-oriented, and I can tell you I did not have C++ in mind."

Joe Armstrong - "Objects bind functions and data structures together in indivisible units. I think this is a fundamental error since functions and data structures belong in totally different worlds."

I'm a student practice, and our project is library system. The library system isn't hard but, the company don't want to use Internet, it's fine, but when I saw our project, it was build on MVC 5 with Entity framework, and this project is complete about 70% (interface and database is done but logic isn't complete yet).

Our project will run on 4 computers, I have a question, is MVC the good way? When this project complete, how to connect database between 4 computers?

XMLPullParser is being used to read XML files but was throwing an exception on what an XML editor says is a perfectly legitimate XML file. Stepping through the XMLPullParser in debug mode, it appears that the problem is that an import is failing because java cannot resolve the symbol "libcore":

import libcore.internal.StringPool;

With the result that an exception seems to be thrown when calling the .get(char[], int, int) method of StringPool. (But the final exception that is thrown is an unexpected token on row 1 column 2.)

According to the debugger the StringPool constructor, called from the parser constructor, is not resolveable either, but no exception seems to be being thrown by the parser constructor.


I got Mac book (OS X 10.11.6) acts as BLE Central device and Android Phone (Os 6.0) acts as Peripheral device.

Android Peripheral advertises characteristic-1 with properties BluetoothGattCharacteristic.PROPERTY_WRITE | BluetoothGattCharacteristic.PROPERTY_NOTIFY

Mac book(BLE Central) discovers Android Peripheral successfully with characteristic-1. However, when BLE Central tries to do setNotifyValue:YES for this characteristic fails with below error.

Error changing notification state:Error Domain=CBErrorDomain Code=0 "Unknown error." UserInfo={NSLocalizedDescription=Unknown error.}

Incase, if the Peripheral device is an iPhone(iOS) which has similar characteristic then setNotifyValue:YES gets succeeded.

I tried the below combinations for the characteristic-1 with

1- BluetoothGattCharacteristic.PROPERTY_WRITE | BluetoothGattCharacteristic.PROPERTY_INDICATE

2- BluetoothGattCharacteristic.PROPERTY_READ | BluetoothGattCharacteristic.PROPERTY_NOTIFY

3- BluetoothGattCharacteristic.PROPERTY_READ | BluetoothGattCharacteristic.PROPERTY_INDICATE

But unfortunately none of them worked.

Can some one help me in setting notifiable to YES on Mac OS X Central for Android Peripheral characteristic ?

I am constructing a View through som methodes and at the end I am getting a View object which i then add to a LinearLayout. The problem ist in the last class before I add it to the Linearlayout I want to add another view programmatically. When I try this I don't get any error but the view is somehow invisible. Here is my code:

View newView = new ListItemView().getView(viewList.get(i));

            if (AppData.postDimRead) {
                if (dimList.contains(viewList.get(i))) {
                    try {
                        Log.e("found", "dimView");
                        View viewMask = new View(AppData.context);
                        RelativeLayout.LayoutParams maskParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
                        RelativeLayout rootView = (RelativeLayout) newView.findViewById(;
                        rootView.addView(viewMask, maskParams);
                    } catch (Exception e) {


I have attached a ViewPager to a TabLayout and moved the layout to the bottom of the screen.

Now, is this possible to move the TabStrip to the top of the Tab? Preferably without using custom drawables, overriding backgrounds etc.?

TabStrips showing on bottom of Tab

PS: I am aware that bottom tabs does not follow Google's Material design guidelines.

My question is whether the set of features in hybrid IOS and Android must be exactly the same or may differ? Due to appstore regulations we must cut 2 features in IOS and have them available only on web. Google play doesn't have such strict guidelines so we may not cut them in Android. I realize that technically we may have IOS and Android different but would it be a good approach to stick to? Would the users like it. Please advise if anyone experienced such case and what was the outcome/feedback from end users

What is the algorithm to verify that a mobile device's Apple IDFA or Google Advertiser ID is genuine? There's probably some logic behind the creation of these IDs, but I can seem to find it anywhere..

Getting this kind of error using AppseleratorStudio (Titanium). I am using MacBook Pro with iPad mini. Appcelerator Studio, build: iPad mini has 8.1 version of software. Seen similar questions being asked, but not many answers were given and most of the questions were Android related. Willing to provide more info needed if necessary.

2016-08-22T08:48:24.385Z | DEBUG  | getTiDefaultPath /Users/at/Library/Application Support/Titanium
    2016-08-22T08:48:24.386Z | DEBUG  | active sdk install path /Users/at/Library/Application Support/Titanium
    2016-08-22T08:48:26.476Z | DEBUG  | to download {"modules":[{"oses":["linux","win32","osx"],"platforms":["iphone","android"],"required":true,"partner_id":"A0B129A418829127EC551EB8ADB0D1CC","partner_name":"Appcelerator","name":"Hyperloop","description":"Gain complete access to native APIs in your Titanium mobile applications.","id":"hyperloop","guid":"99a136cd-4e51-40da-bcdb-d514f5895fb5","version":"1.2.6","url":"","min_mobilesdk_version":"5.4.0"}],"components":[]}
    [ERROR] :  Invalid "--device-id" value ""
    Available iOS Devices:
      814afcb29c793aea10b182b53f3f629b73ed1a39  iPad mini
      itunes                                    iTunes Sync
    For help, run: titanium.js help build

When I try to display a UIAlertController from my app, the app terminates with an exception UIViewControllerHierarchyInconsistency.

The View Controller is created with a storyboard

From Storyboard editor

I create and (try to) display the Alert like this:

UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Title" message:@"Message" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *yesButton = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
[alert addAction:yesButton];

[self presentViewController:alert animated:YES completion:nil];

However, during execution I get this in the output:

2016-08-25 09:46:07.536 TrackYou[10554:3165715] *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<UICompatibilityInputViewController: 0x13f5afd80> should have parent view controller:<ViewController: 0x13f549360> but requested parent is:<UIInputWindowController: 0x140043c00>'

From the same ViewController I use the presentViewController to present a custom ViewController, which works fine.

SettingsViewController *controller = [SettingsViewController new];
[self presentViewController:controller animated:YES completion:nil];

Any ideas what's causing the problem?

I make rotation by 180 degrees by code

- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath {
    UICollectionViewLayoutAttributes *retAttr = [[super layoutAttributesForItemAtIndexPath:indexPath] copy];

    if (CGAffineTransformIsIdentity(retAttr.transform)) {
        retAttr.transform = CGAffineTransformMakeRotation(M_PI);

    retAttr.frame = CGRectMake(0, retAttr.frame.origin.y, self.collectionView.bounds.size.width, retAttr.frame.size.height);
    return retAttr;

Frame by CGRectMake

(origin = (x = 0, y = 3658), size = (width = 320, height = 1077.5))

But i got

(lldb) po retAttr.frame
(origin = (x = -0.000000000000056843418860808015, y = 3658), size = (width = 320.00000000000011, height = 1077.5))

And cell disappear from screen.

How to correctly rotate or assign frame to x not breaks and width too?