mercredi 31 décembre 2014

How to get User Data from Facebook?

I am new in iOS Development, I am trying to do get Details of User from Facebook. Here is my code which i am used but when it called my app is hang. In below code it can not worked when i can not Login with device in Facebook in Setting>Facebook. Please help me for this.



-(Void)LoginWithFB {
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
ACAccountType *facebookAccountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
SLComposeViewController *vc = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
id options = @{
ACFacebookAppIdKey: @"1501842240102594",
ACFacebookPermissionsKey: @[ @"email"],

};
[accountStore requestAccessToAccountsWithType:facebookAccountType
options:options
completion:^(BOOL granted, NSError *error) {
if (granted)
{
// Return back logined facebook Account
ACAccount *fbAccount = [[accountStore accountsWithAccountType:facebookAccountType] lastObject];

// Do What you want...
// Request friend list
//http://ift.tt/1xwqDQC
SLRequest *friendsListRequest = [SLRequest requestForServiceType:SLServiceTypeFacebook
requestMethod:SLRequestMethodGET
URL: [[NSURL alloc] initWithString:@"http://ift.tt/P3QvMV"]parameters:nil];
friendsListRequest.account = fbAccount;
[friendsListRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {

// Parse response JSON
NSError *jsonError = nil;
NSDictionary *dictionaryForFacebookData = [NSJSONSerialization JSONObjectWithData:responseData
options:NSJSONReadingAllowFragments
error:&jsonError];

// NSString *proficePicture = [NSString stringWithFormat:@"http://ift.tt/1xwqDQI"];

NSMutableDictionary *dictionaryParameter = [[NSMutableDictionary alloc]init];
[dictionaryParameter setObject:@"facebook" forKey:@"registrationsource"];
[dictionaryParameter setObject:[dictionaryForFacebookData objectForKey:@"first_name"] forKey:@"firstname"];
[dictionaryParameter setObject:[dictionaryForFacebookData objectForKey:@"last_name"] forKey:@"lastname"];
[dictionaryParameter setObject:[dictionaryForFacebookData objectForKey:@"email"] forKey:@"email"];
[dictionaryParameter setObject:@"yes" forKey:@"status"];

WebServiceClass *objectToCallApi = [[WebServiceClass alloc]init];
NSDictionary *dictionaryReturnValue = [objectToCallApi callAPIWebservice:dictionaryParameter stringURL:[[Singelton sharedInstance] passMethodName:@"login"]];
if (![[dictionaryReturnValue objectForKey:@"success"] isEqualToString:@"1"])
{
[UIAlertView showWithTitle:ALERT_TITLE message:[dictionaryReturnValue objectForKey:@"message"] handler:^(UIAlertView *alertview, NSInteger buttonindex){
}];
}

if ([[dictionaryReturnValue objectForKey:@"success"] isEqualToString:@"1"])
{
APP_DELEGATE.intTabbarNumber = 0;
NSMutableDictionary *data =[[NSMutableDictionary alloc]init];
[data setObject:[NSString stringWithFormat:@"%@ %@",[dictionaryReturnValue objectForKey:@"firstname"], [dictionaryReturnValue objectForKey:@"lastname"]] forKey:@"fullname"];
[data setObject:dictionaryReturnValue[@"username"] forKey:@"username"];
[data setObject:dictionaryReturnValue[@"email"] forKey:@"email"];
[data setObject:dictionaryReturnValue[@"userid"] forKey:@"userid"];
NSMutableArray *arrayOfExistingUser;
if([[NSUserDefaults standardUserDefaults] valueForKey:@"Users"] != nil)
{
arrayOfExistingUser = [[[NSUserDefaults standardUserDefaults] valueForKey:@"Users"] mutableCopy];
for (int i=0; i<arrayOfExistingUser.count; i++)
{
if ([[[arrayOfExistingUser objectAtIndex:i]objectForKey:@"userid"] isEqualToString:[data objectForKey:@"userid"]])
{
[arrayOfExistingUser removeObjectAtIndex:i];
}
}
}
else
{
arrayOfExistingUser = [[NSMutableArray alloc]init];
}

[arrayOfExistingUser addObject:data];
[[NSUserDefaults standardUserDefaults] setObject:arrayOfExistingUser forKey:@"Users"];
[[NSUserDefaults standardUserDefaults] synchronize];

[[NSUserDefaults standardUserDefaults]setObject:dictionaryReturnValue forKey:@"dictionaryForLoginData"];

if ([[dictionaryReturnValue objectForKey:@"role"] isEqualToString:@"teacher"])
{
[APP_DELEGATE createTabbarInstanceForTeacher];
}
else if ([[dictionaryReturnValue objectForKey:@"role"] isEqualToString:@"student"])
{
[APP_DELEGATE createTabbarInstanceForstudent];
}
else if ([[dictionaryReturnValue objectForKey:@"role"] isEqualToString:@"parent"])
{
[APP_DELEGATE createTabbarInstanceForParent];
}
}
}];
}
else
{
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[controller.view resignFirstResponder];
controller.view.hidden = YES;

[self presentViewController:controller animated:NO completion:nil];
}
}];
}



how SKSpriteNode's node size affect performance?

when xcode generate texture atlas, it's load that texture atlas once.


my question is when texture atlas generating by xcode is he also draw it into memory and that's cause fast batch processing takes place when i assign that textureImage to skspriteNode object....???


when skspriteNode object created what happen when we addchild to sceneNode??? is spriteNode object node size matter and why should we place small size texture ???????


more in short what addchild do under the hood in scene,is he draw the texture ,what???




Use multiple font colors in a single label - xcode - swift

Is there a way to use two, or even three font colors in a single label in xcode? If the text "hello, how are you" were used as an example, the "hello," would be blue, and the "how are you" would be green? Is this possible, it seems easier than creating multiple labels




How to create a Tinder type UINavigationController?

I have went through some tutorials and example projects to find out a way to create a UINavigationController like in the Tinder app. This is the best example that I've got so far : http://ift.tt/1BntgBy


But the problem I'm facing is, I have no idea to animate the buttons like in the Tinder app. Please check this image:


Please check this image:


Does anyone know how to achieve this?




Swift Bug or Coding Error? For Loops in Structs

So I am trying to make an iOS app that checks prime numbers in an input field as practice. I refactored my code to have a struct specifically for calculation functions like isPrime. For some reason my for loops is not working correctly when its in the struct. It works if I refactored it back into the controller.



func isPrime(number:Int) -> Bool{
let start = 2
for var i = number-1; i > 1; i-- {
if (number % i == 0){
return true
}
}
return false
}


The debugger thingy gives back these inputs: Types 12 into text field




number = 12


i = 14070095816392014214




Why is my variable i in the for loops so damn large? I also tested putting a stray variable inside the function and it does the same thing (ex; start_int = 14214124123232423)?




Data passed between ViewControllers and being Reset?

I'm simply trying to pass an NSInteger between 2 Viewcontrollers and for some reason, the data keeps getting reset. What I mean by reset is as I do the following:



- (void)pickerView:(AKPickerView *)pickerView didSelectItem:(NSInteger)item
{
PlayViewController *playScreen = [[PlayViewController alloc] init];
playScreen.playerNumber = item;
NSLog(@"%d", playScreen.playerNumber);
}


The NSLog would then print out whatever the index of the chosen object is but once I go to PlayViewController and do the following switch statement:



switch (self.playerNumber){
case 0:
theView.playerComment.text = @"You, again";
playerScores[0]++;
break;

case 1:
if (numberPressed % 2){
theView.playerComment.text = @"Player 2's Turn";
playerScores[0]++;
}
else {
theView.playerComment.text = @"Player 1's Turn";
playerScores[1]++;
}
break;
and so on.... the code would always receive 0 as the value of playerNumber...


Also, in PlayViewController.h, the variable player number is declared as such:



@property (nonatomic) NSInteger playerNumber;



NSURLConnection/Session. GET request. sending parameters as data, and not part of the URL

I'm only familiar with making GET request from manually constructing a string of parameters. I was told be the by the admin of the API that they are not set up to parse my parameters and that I have to send a JSON array of parameters. In this case, it is a parameter of phone numbers?


I'm familiar with sending data an an POST request via:



NSURLSessionUploadTask *uploadTask = [session uploadTaskWithRequest:request fromData:data completionHandler:^(NSData *data,NSURLResponse *response,NSError *error


But that doesn't seem like an option to me for GET methods.


Thanks!




how to share Image on Facebook using Swift in IOS

I want to share an image on Facebook using swift language. I am able to share image using Objective C. I tried using


1) How to Share image + text with facebook in swift iOS?


but not working, then I tried using other options but not able to share image using swift language. then I tried this


2) http://ift.tt/1ELj3F8


I copied Facebook.swift and write another function for share image my code for Facebook.swift



import Foundation
import Social

let FB = Facebook();

class Facebook {

var fbSession:FBSession?

init(){
self.fbSession = FBSession.activeSession();
}

func hasActiveSession() -> Bool{
let fbsessionState = FBSession.activeSession().state;
if ( fbsessionState == FBSessionState.Open
|| fbsessionState == FBSessionState.OpenTokenExtended ){
self.fbSession = FBSession.activeSession();
return true;
}
return false;
}

func login(callback: () -> Void){

let permission = ["publish_actions","email","user_location","user_birthday","user_hometown","user_photos","user_about_me"];
let activeSession = FBSession.activeSession();
let fbsessionState = activeSession.state;
var showLoginUI = true;

if(fbsessionState == FBSessionState.CreatedTokenLoaded){
showLoginUI = false;
}

if(fbsessionState != FBSessionState.Open
&& fbsessionState != FBSessionState.OpenTokenExtended){

FBSession.openActiveSessionWithPublishPermissions(permission, defaultAudience: FBSessionDefaultAudience.Friends, allowLoginUI: showLoginUI, completionHandler: { (session:FBSession!, state:FBSessionState, error:NSError!) -> Void in

if(error != nil){
println("Session Error: \(error)");
}
self.fbSession = session;
// println("Session : \(self.fbSession?.permissions)");
callback();

})

// FBSession.openActiveSessionWithReadPermissions(
// permission,
// allowLoginUI: showLoginUI,
// completionHandler: { (session:FBSession!, state:FBSessionState, error:NSError!) in
//
// if(error != nil){
// println("Session Error: \(error)");
// }
// self.fbSession = session;
// println("Session : \(self.fbSession?.permissions)");
// callback();
//
// }
// );
return;
}

callback();

}

func logout(){
self.fbSession?.closeAndClearTokenInformation();
self.fbSession?.close();
}

func getInfo(){
FBRequest.requestForMe()?.startWithCompletionHandler({(connection:FBRequestConnection!, result:AnyObject!, error:NSError!) in

if(error != nil){
println("Error Getting ME: \(error)");
}

println("\(result)");
var dictData:NSDictionary!=result as? NSDictionary
});
}

func handleDidBecomeActive(){
FBAppCall.handleDidBecomeActive();
}

func shareImage (imageName:UIImageView){
let fbsessionState = FBSession.activeSession().state;
if(fbsessionState == FBSessionState.Open)
{
//var arr : NSArray=NSArray(array: ["publish_actions"])
self.fbSession?.requestNewPublishPermissions(["publish_actions"], defaultAudience:FBSessionDefaultAudience.Friends, completionHandler: { (session:FBSession!, error:NSError!) -> Void in
if(error == nil){
var requestConneciton:FBRequestConnection=FBRequestConnection()
requestConneciton.errorBehavior=FBRequestConnectionErrorBehavior.None

requestConneciton.addRequest(FBRequest(forUploadPhoto:imageName.image)) { (connection:FBRequestConnection!, result:AnyObject!, error:NSError!) -> Void in
println("\(error)");
println("\(result)");
//[self showAlert:@"Photo Post" result:result error:error];
}
requestConneciton.start()

}
else if(error.fberrorCategory == FBErrorCategory.UserCancelled){
var alt:UIAlertView!=UIAlertView(title:"Permission denied", message:"Unable to get permission to post", delegate:nil, cancelButtonTitle:"Ok")
alt.show()
}

})
}
}

func showAlert(msg:NSString!,result:AnyObject,error:NSError!) {
var alertTitle:NSString!
var alertMsg:NSString!;
if (error == nil) {
if((error.fberrorUserMessage != nil && FBSession.activeSession().isOpen) ) {
alertTitle = "";
}
else{
// Otherwise, use a general "connection problem" message.
alertMsg = "Operation failed due to a connection problem, retry later.";
}
}
else {
//var dictResult:NSDictonary = result as NSDictionary
alertMsg="Successfully posted "
var alertObj:UIAlertView!=UIAlertView(title:"Demo App", message:alertMsg, delegate:nil, cancelButtonTitle:"Ok");
alertObj.show();
}
}

func performPublishAction(action:() -> Void){

var arrP:NSArray!=NSArray(array: ["publish_actions"]);

fbSession?.requestNewPublishPermissions(arrP, defaultAudience:FBSessionDefaultAudience.Friends, completionHandler: { (session:FBSession!, error:NSError!) -> Void in

if(error == nil){
action()
}
else if(error.fberrorCategory == FBErrorCategory.UserCancelled){
var alt:UIAlertView!=UIAlertView(title:"Permission denied", message:"Unable to get permission to post", delegate:nil, cancelButtonTitle:"Ok")
alt.show()
}

})
}
}


and In ViewController.swift



import UIKit

class ViewController: UIViewController,FBLoginViewDelegate {

@IBOutlet var imageObj:UIImageView!

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}

@IBAction func btnFBLoginClick(sender: UIButton) {
FB.login(self.handleLogin);
}

func handleLogin(){
println("SUCCESS");
FB.getInfo();
}

@IBAction func btnShareclick(sender: UIButton) {
FB.shareImage(imageObj)
}

}


Login button click working perfect and it can fetch all data of login user, but when i share the image using FB.shareImae(imageObj) its give me a permission error, I am working on this point from last 2 days now I am stuck. if i write same code in Objective C its working fine.


eror :



permissions:(
"public_profile",
email,
"user_friends"
)>, com.facebook.sdk:ParsedJSONResponseKey={
body = {
error = {
code = 200;
message = "(#200) Permissions error";
type = OAuthException;
};
};
code = 403;
}}


Can any one help me? to find out this problem...


I don't want to use SLComposeViewController, I want to use Facebook framework.


Thank you in advance!




Custom NSSortDescriptor for NSFetchedResultsController

I have a custom "sort" that I currently perform on a set of data. I now need to perform this sort on the fetchedObjects in the NSFetchedResultsController. All of our table data works hand in hand with core data fetched results so replacing the data source with a generic array has been problematic.


Since NSFetchedResultsController can take NSSortDescriptors it seems like that is the best route. The problem is I don't know how to convert this sort algorithm into an custom comparator.


How do I convert this into a custom comparator (if possible)? (if not how do I get the desired sorted result while using NSFetchedResultsController). In essence the field 'priority' can be either 'high' 'normal' or 'low' and the list needs to be sorted in that order.



+(NSArray*)sortActionItemsByPriority:(NSArray*)listOfActionitemsToSort
{
NSMutableArray *sortedArray = [[NSMutableArray alloc]initWithCapacity:listOfActionitemsToSort.count];
NSMutableArray *highArray = [[NSMutableArray alloc]init];
NSMutableArray *normalArray = [[NSMutableArray alloc]init];
NSMutableArray *lowArray = [[NSMutableArray alloc]init];

for (int x = 0; x < listOfActionitemsToSort.count; x++)
{
ActionItem *item = [listOfActionitemsToSort objectAtIndex:x];

if ([item.priority caseInsensitiveCompare:@"high"] == NSOrderedSame)
[highArray addObject:item];
else if ([item.priority caseInsensitiveCompare:@"normal"] == NSOrderedSame)
[normalArray addObject:item];
else
[lowArray addObject:item];
}

[sortedArray addObjectsFromArray:highArray];
[sortedArray addObjectsFromArray:normalArray];
[sortedArray addObjectsFromArray:lowArray];

return sortedArray;
}


UPDATE Tried using a NSComparisonResult block but NSFetchedResultsController does not allow that


Also tried using a transient core data attribute and then calculating a field that I could sort. But the sort takes place before the field is calculated so that didn't work.


I tried setting sections for each priority type - which worked. But it wasn't displaying in the right order and apparently you cannot order sections with core data.


Any other thoughts?




Turning off Unauthenticated Identities in Amazon Cognito for IOS

I disabled access to Unauthenticated Identities and found that my Logging threw these messages:



2014-12-31 13:43:33.010 com.tharock[421:136403] AWSiOSSDKv2 [Verbose] AWSURLResponseSerialization.m line:263 | -[AWSXMLResponseSerializer responseObjectForResponse:originalRequest:currentRequest:data:error:] | Response body: [<ErrorResponse xmlns="http://ift.tt/17546ih">
<Error>
<Type>Sender</Type>
<Code>ValidationError</Code>
<Message>Request ARN is invalid</Message>
</Error>
<RequestId>111c34e1-9136-11e4-92c2-75de57cf7c5e</RequestId>
</ErrorResponse>
]
2014-12-31 13:43:33.027 com.tharock[421:136403] AWSiOSSDKv2 [Error] AWSCredentialsProvider.m line:433 | __40-[AWSCognitoCredentialsProvider refresh]_block_invoke293 | Unable to refresh. Error is [Error Domain=com.amazonaws.AWSSTSErrorDomain Code=0 "The operation couldn’t be completed. (com.amazonaws.AWSSTSErrorDomain error 0.)" UserInfo=0x1740f7a00 {Type=Sender, Message=Request ARN is invalid, Code=ValidationError, __text=(
"\n ",
"\n ",
"\n ",
"\n "
)}]
2014-12-31 13:43:33.028 com.tharock[421:136403] Error: Error Domain=com.amazonaws.AWSSTSErrorDomain Code=0 "The operation couldn’t be completed. (com.amazonaws.AWSSTSErrorDomain error 0.)" UserInfo=0x1740f7a00 {Type=Sender, Message=Request ARN is invalid, Code=ValidationError, __text=(
"\n ",
"\n ",
"\n ",
"\n "
)}


Is it complaining about my CognitoRoleUnauth parameter defined in Constants.h? I have valid ARN supplied for CognitoRoleAuth, and valid CognitoPoolID and account. It has been working well with the unauthenticated Identity, but I must close that off now.




Custom view sometimes appears with wrong background color

I have a custom 'Dot' view that is a circle with a border and background color, similar to the dots in the upper-left hand corner of iOS 7+ that show signal strength.


A dot can either be filled or not filled.


Filled dot:


Filled Dot


Not filled dot:


Not Filled Dot


The problem: 20-30% of the time I launch the app, non-filled dots appear with a yellow background, even though white is explicitly specified.


Unexpected yellow dots


Here is the code in drawRect:



- (void)drawRect:(CGRect)rect
{
CGRect borderRect = CGRectInset(rect, 3, 3);
CGContextRef ctx = UIGraphicsGetCurrentContext();
if (self.filled) {
CGContextSetFillColor(ctx, CGColorGetComponents([self.color CGColor]));
} else {
CGContextSetFillColor(ctx, CGColorGetComponents([[UIColor whiteColor] CGColor]));
}
CGContextSetStrokeColor(ctx, CGColorGetComponents([self.color CGColor]));
CGFloat lineWidth = rect.size.height/10;
if (lineWidth < 1) {
lineWidth = 1.0;
}
CGContextSetLineWidth(ctx, lineWidth);
CGContextFillEllipseInRect(ctx, borderRect);
CGContextStrokeEllipseInRect(ctx, borderRect);
CGContextFillPath(ctx);
}


self.color is never being set to yellow. Only the blue color you see as a border.


What could be causing these to sometimes appear yellow?




iOS 8 - performSegueWithIdentifier loads view but doesn't show it the first time

I have a Tab Bar application, and one of the tabs, which contains a Table View, segues into a third view when a table cell is pressed. The view controller acts as a delegate for the UITableView, and I trigger the segue programatically as follows:



func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
println("cell tapped, starting segue")
performSegueWithIdentifier("showDetails", sender: self)
}

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
println("prep for segue")
// TODO - more code here
}


Finally, I set up the following code to debug the problem with the third view:



class DetailsViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
println("did load")
}
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
println("will appear")
}
}


The problem is that when I press a table cell for the first time, the viewWillAppear function never gets called until I interact with the UI in some way (e.g. just a tap anywhere on the screen). The view that I want to segue into doesn't show up, as if the screen didn't get refreshed. However, when I tap the screen, the whole animation runs and I can segue as intended. This is my output when I tap a cell:



cell tapped, starting segue
prep for segue
did load


I tried to find solutions online, but all the issues I found it seems to just not work at all. In my case, it is working, but not immediately.


In case it helps, here's a screenshot of my storyboard:


Screenshot of my Storyboard




push data via segue without deleting previous data

I have a table view controller with text fields that save using core data. I also have a search display view controller and i link them together using push segue and use another push with Prepareforsegue to link to information back to the same table view controller. But my issue is that the information is not saving back to the original table view controller but is creating a new one each time i call the prepare for segue.




Here is the table view controller code -



//

// PersonDetailTVC.m

// Staff Manager

//

// Created by Tim Roadley on 14/02/12.

// Copyright (c) 2012 __MyCompanyName__. All rights reserved.

//



#import "PersonDetailTVC.h"

#import "PersonsTVC.h"

#import <LibXL/LibXL.h>



@implementation PersonDetailTVC{



NSArray *recipes;

NSArray *searchResults;

UIImage *image;

UIImage *imagetwo;

UIImage *imagethree;

UIImage *imagefour;

UIImage *imagefive;

UIImage *imagesix;

UIImage *imageseven;

UIImage *imageeight;

UIImage *imagenine;

UIImage *imageten;

}



@synthesize delegate;

@synthesize person = _person;



@synthesize selectedRole;



@synthesize recipeLabel;

@synthesize recipeName;

@synthesize LinkLabel;







@synthesize personroomTextField = _personroomTextField;

@synthesize personFirstnameTextField = _personFirstnameTextField;

@synthesize personaddressTextField = _personaddressTextField;



@synthesize personcityTextField = _personcityTextField;





@synthesize personstateTextField = _personstateTextField;

@synthesize personstateTextField1 = _personstateTextField1;



@synthesize personzipTextField = _personzipTextField;





@synthesize personinsuranceTextField = _personinsuranceTextField;



@synthesize personclaimTextField = _personclaimTextField;



@synthesize persontaxTextField = _persontaxTextField;



@synthesize personRoleTableViewCell = _personRoleTableViewCell;





@synthesize personquantityTextField = _personquantityTextField;





@synthesize personageTextField = _personageTextField;





@synthesize persondescTextField = _persondescTextField;



@synthesize personserialTextField = _personserialTextField;



@synthesize personpriceTextField = _personpriceTextField;



@synthesize personnotesTextField = _personnotesTextField;



@synthesize personrcvperTextField = _personrcvperTextField;



@synthesize persontotaldepTextField = _persontotaldepTextField;



@synthesize personacvTextField = _personacvTextField;



@synthesize personconditionTextField = _personconditionTextField;



@synthesize personstoredImage = _personstoredImage;



@synthesize personimgThumbNail = _personimgThumbNail;

- (void)viewDidLoad

{

NSLog(@"Setting the value of fields in this static table to that of the passed Person");



self.personFirstnameTextField.text = self.person.firstname;

self.personaddressTextField.text = self.person.address;

self.personcityTextField.text = self.person.city;

self.personstateTextField.text = self.person.state;

self.personzipTextField.text = self.person.zip;

self.personinsuranceTextField.text = self.person.insurance;

self.personclaimTextField.text = self.person.claim;

self.persontaxTextField.text = self.person.tax;

self.personquantityTextField.text = self.person.quantity;

self.personRoleTableViewCell.textLabel.text = self.person.inRole.name;

self.personRoleTableViewCelltwo.textLabel.text = self.person.inRole.name;

self.personquantityTextField.text = self.person.quantity;

self.personconditionTextField.text = self.person.condition;

self.personageTextField.text = self.person.age;

self.persondescTextField.text = self.person.desc;

self.personserialTextField.text = self.person.serial;

self.personnotesTextField.text = self.person.notes;

self.personpriceTextField.text = self.person.price;

self.personrcvperTextField.text = self.person.rcvper;

self.personacvTextField.text = self.person.acv;

self.persontotaldepTextField.text = self.person.totaldep;

self.selectedRole = self.person.inRole; // ensure null role doesn't get saved.

self.selectedRoletwo = self.person.inRole; // ensure null role doesn't get saved.



self.personroomTextField.text = self.person.room;

self.personroomTextField1.text = self.person.room1;

self.personroomTextField2.text = self.person.room2;

self.personroomTextField3.text = self.person.room3;

self.personroomTextField4.text = self.person.room4;

self.personroomTextField5.text = self.person.room5;

self.personroomTextField6.text = self.person.room6;

self.personroomTextField7.text = self.person.room7;

self.personroomTextField8.text = self.person.room8;

self.personroomTextField9.text = self.person.room9;

self.personroomTextField10.text = self.person.room10;







self.title = self.recipe.name;

self.prepTimeLabel.text = self.recipe.prepTime;

self.recipeNameLabel.text = self.recipe.name;

self.LinkLabel.text = self.recipe.Link;



self.prepTimeLabel1.text = self.recipe.prepTime1;

self.recipeNameLabel1.text = self.recipe.name;

self.LinkLabel1.text = self.recipe.Link1;



self.persontotaldepTextField50.text = self.person.totaldep50;

self.selectedRole = self.person.inRole; // ensure null role doesn't get saved.



[self.tableView reloadData];

UITapGestureRecognizer *tgr = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissKeyboard)];

[tgr setCancelsTouchesInView:NO];

[self.tableView addGestureRecognizer:tgr];











[super viewDidLoad];







}





- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

if ([segue.identifier isEqualToString:@"showRecipeDetail"]) {

NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];

PersonDetailTVC *destViewController = segue.destinationViewController;

destViewController.person = [recipes objectAtIndex:indexPath.row];





}

}







- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {



if (indexPath.section == 0) {

switch (indexPath.row) {

case 0:

[self.personFirstnameTextField becomeFirstResponder];

break;

case 1:

[self.personaddressTextField becomeFirstResponder];

case 2:

[self.personcityTextField becomeFirstResponder];

case 3:

[self.personstateTextField becomeFirstResponder];

case 4:

[self.personzipTextField becomeFirstResponder];

case 6:

[self.personinsuranceTextField becomeFirstResponder];

case 7:

[self.personclaimTextField becomeFirstResponder];

case 8:

[self.persontaxTextField becomeFirstResponder];

case 9:

[self.personquantityTextField becomeFirstResponder];

case 10:

[self.personconditionTextField becomeFirstResponder];

case 11:

[self.personageTextField becomeFirstResponder];

case 12:

[self.persondescTextField becomeFirstResponder];

case 13:

[self.personserialTextField becomeFirstResponder];

case 14:

[self.personpriceTextField becomeFirstResponder];

case 15:

[self.personnotesTextField becomeFirstResponder];

case 16:

[self.personrcvperTextField becomeFirstResponder];

case 17:

[self.personacvTextField becomeFirstResponder];

case 18:

[self.persontotaldepTextField becomeFirstResponder];

case 19:

[self.personstoredImage becomeFirstResponder];





default:

break;

}

}

}



- (void)viewDidUnload

{

//[self setPersonNameTextField:nil];

[self setPersonFirstnameTextField:nil];

[self setPersonaddressTextField:nil];

[self setPersoncityTextField:nil];

[self setPersonstateTextField:nil];

[self setPersonzipTextField:nil];

[self setPersoninsuranceTextField:nil];

[self setPersonclaimTextField:nil];

[self setPersontaxTextField:nil];

[self setPersonquantityTextField:nil];

[self setPersonRoleTableViewCell:nil];

[self setPersonRoleTableViewCelltwo:nil];

[self setPersonconditionTextField:nil];

[self setPersonageTextField:nil];

[self setPersonserialTextField:nil];

[self setPersondescTextField:nil];

[self setPersonpriceTextField:nil];

[self setPersonnotesTextField:nil];

[self setPersonrcvperTextField:nil];

[self setPersontotaldepTextField:nil];

[self setPersonacvTextField:nil];



[super viewDidUnload];

NSString *fullURL = @"http://conecode.com";

NSURL *url = [NSURL URLWithString:fullURL];

NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];

[_viewWeb loadRequest:requestObj];

}



- (IBAction)save:(id)sender

{

NSLog(@"Telling the PersonDetailTVC Delegate that Save was tapped on the PersonDetailTVC");



self.person.firstname = self.personFirstnameTextField.text; // Set Firstname

self.person.address = self.personaddressTextField.text; // Set Surname

self.person.city = self.personcityTextField.text;

self.person.state = self.personstateTextField.text;

self.person.zip = self.personzipTextField.text;

self.person.insurance = self.personinsuranceTextField.text;

self.person.claim = self.personclaimTextField.text;

self.person.tax = self.persontaxTextField.text;

self.person.quantity = self.personquantityTextField.text;

self.person.condition = self.personconditionTextField.text;

self.person.age = self.personageTextField.text;

self.person.desc = self.persondescTextField.text;

self.person.serial = self.personserialTextField.text;

self.person.price = self.personpriceTextField.text;

self.person.notes = self.personnotesTextField.text;

self.person.rcvper = self.personrcvperTextField.text;

self.person.acv = self.personacvTextField.text;

self.person.totaldep = self.persontotaldepTextField.text;





[self.persontwo setInRole:self.selectedRole]; // Set Relationship!!!

[self.persontwo.managedObjectContext save:nil]; // write to database

[self.delegate personDetailTVCDidSave:self];

[self.person setInRole:self.selectedRole]; // Set Relationship!!!

[self.person setInRole:self.selectedRoletwo];

[self.person.managedObjectContext save:nil]; // write to database

[self.delegate personDetailTVCDidSave:self];

}







- (void)dismissKeyboard {

[self.view endEditing:TRUE];

}



- (void)roleWasSelectedOnPersonRoleTVC:(PersonRoleTVC *)controller

{

self.personRoleTableViewCell.textLabel.text = controller.selectedRole.name;

self.selectedRole = controller.selectedRole;

NSLog(@"PersonDetailTVC reports that the %@ role was selected on the PersonRoleTVC", controller.selectedRole.name);

[self.person setInRole:self.selectedRole];

[self.person.managedObjectContext save:nil];

[delegate personDetailTVCDidSave:self];

[controller.navigationController popViewControllerAnimated:YES];



self.personRoleTableViewCelltwo.textLabel.text = controller.selectedRole.name;

self.selectedRoletwo = controller.selectedRole;

NSLog(@"PersonDetailTVC reports that the %@ role was selected on the PersonRoleTVC", controller.selectedRole.name);

[self.person setInRole:self.selectedRoletwo];

[self.person.managedObjectContext save:nil];

[delegate personDetailTVCDidSave:self];

[controller.navigationController popViewControllerAnimated:YES];

}



- (void)personChangedOnMaster:(PersonsTVC *)controller {



self.person = controller.selectedPerson;

NSLog(@"PersonDetailTVC.m: personChangedOnMaster: %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@",self.person.firstname, self.person.address, self.person.city, self.person.state, self.person.zip, self.person.insurance, self.person.claim, self.person.tax, self.person.quantity, self.person.condition, self.person.age, self.person.desc, self.person.serial, self.person.price, self.person.notes, self.person.rcvper, self.person.totaldep,



self.person.serial1, self.person.price1, self.person.notes1, self.person.rcvper1, self.person.totaldep1,



self.person.serial2, self.person.price2, self.person.notes2, self.person.rcvper2, self.person.totaldep2,



self.person.serial3, self.person.price3, self.person.notes3, self.person.rcvper3, self.person.totaldep3,



self.person.serial4, self.person.price4, self.person.notes4, self.person.rcvper4, self.person.totaldep4,



self.person.serial5, self.person.price5, self.person.notes5, self.person.rcvper5, self.person.totaldep5,



self.person.serial6, self.person.price6, self.person.notes6, self.person.rcvper6, self.person.totaldep6,



self.person.serial7, self.person.price7, self.person.notes7, self.person.rcvper7, self.person.totaldep7,



self.person.serial8, self.person.price8, self.person.notes8, self.person.rcvper8, self.person.totaldep8,



self.person.serial9, self.person.price9, self.person.notes9, self.person.rcvper9, self.person.totaldep9,



self.person.serial10, self.person.price10, self.person.notes10, self.person.rcvper10, self.person.totaldep10,







self.person.room,

self.person.room1,

self.person.room2,

self.person.room3,

self.person.room4,

self.person.room5,

self.person.room6,

self.person.room7,

self.person.room8,

self.person.room9,

self.person.room10,



self.person.acv, self.person.storedImage);

[self.navigationController popViewControllerAnimated:YES]; // Return detail view to root.

[self viewDidLoad];



self.persontwo = controller.selectedPerson;



NSLog(@"PersonDetailTVC.m: personChangedOnMaster: %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ ",self.person.firstname, self.person.address, self.person.city, self.person.state, self.person.zip, self.person.insurance, self.person.claim, self.person.tax, self.person.quantity, self.person.condition, self.person.age, self.person.desc, self.person.serial, self.person.price, self.person.notes, self.person.rcvper, self.person.totaldep, self.person.acv, self.person.storedImage);

[self.navigationController popViewControllerAnimated:YES]; // Return detail view to root.

[self viewDidLoad];





}



- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

{

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {

return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);

} else {

return YES;

}

}





@end


Here is the search display controller code -



- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"showRecipeDetail"]) {
NSIndexPath *indexPath = nil;
Recipe *recipe = nil;
if (self.searchDisplayController.active) {
indexPath = [self.searchDisplayController.searchResultsTableView indexPathForSelectedRow];
recipe = [searchResults objectAtIndex:indexPath.row];
} else {
indexPath = [self.tableView indexPathForSelectedRow];
recipe = [recipes objectAtIndex:indexPath.row];
}


PersonDetailTVC *destViewController = segue.destinationViewController;
destViewController.recipe = recipe;

[self dismissViewControllerAnimated:YES completion:nil];
}
}



how can I create a menu screen for my spritekit game?

I already put my actual Gamescene inside the MyScene class. How can I create a menu screen even If I already put the game in the MyScene class. I tried to include the menu before the actual gamescene but that didnt work


enter code here-(id)initWithSize:(CGSize)size { if (self = [super initWithSize:size]) {



if (self = [super initWithSize:size]){
SKSpriteNode *startButton = [SKSpriteNode spriteNodeWithImageNamed:@"startButton"];
startButton.position = CGPointMake(160, 300);
startButton.size = CGSizeMake(200, 200);
startButton.name = @"startButton";
[self addChild:startButton];
}
return self;
/* Setup your scene here */
self.anchorPoint = CGPointMake(0.5, 0.5);
self.physicsWorld.contactDelegate = self;
//SKSpriteNode *bgImage = [SKSpriteNode spriteNodeWithImageNamed:@""];
//[self addChild:bgImage];
self.backgroundColor = [SKColor colorWithRed:0.171875 green:0.2421875 blue:0.3125 alpha:1.0];


world = [SKNode node];
[self addChild:world];

self.physicsWorld.contactDelegate = self;

generator = [SPWorldGenerator generatorWithWorld:world];
[self addChild:generator];
[generator populate];


hero = [SPHero hero];
[world addChild:hero];

[self loadScoreLabels];

cloud1 = [SPHero cloud1];
[world addChild:cloud1];

cloud2 = [SPHero cloud2];
[world addChild:cloud2];

cloud3 = [SPHero cloud3];
[world addChild:cloud3];

cloud4 = [SPHero cloud4];
[world addChild:cloud4];
//uihui//

SKLabelNode *tapToBeginLabel = [SKLabelNode labelNodeWithFontNamed:GAME_FONT];
tapToBeginLabel.name = @"tapToBeginLabel";
tapToBeginLabel.text = @"tap to begin";
tapToBeginLabel.fontSize = 20.0;
[self addChild:tapToBeginLabel];
[self animateWithPulse:tapToBeginLabel]; // ** GETS RESET LABEL PULSING ** //

// ** PULSING TEXT ** //
SKAction *disappear = [SKAction fadeAlphaTo:0.0 duration:0.6];
SKAction *appear = [SKAction fadeAlphaTo:1.0 duration:0.6];
SKAction *pulse = [SKAction sequence:@[disappear, appear]];
[tapToBeginLabel runAction:[SKAction repeatActionForever:pulse]];
// ** PULSING TEXT ** //


}

return self;


}


enter code here-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint location = [touch locationInNode:self];



SKNode *node = [self nodeAtPoint:location];

if ([node.name isEqualToString:@"startButton"]) {

SKTransition *transition = [SKTransition doorsOpenVerticalWithDuration:1.0];

MyScene *game = [[MyScene alloc] initWithSize: CGSizeMake(self.size.width, self.size.height)];

[self.scene.view presentScene:game transition:transition];
}


}




Error retrieving Twitter Timeline

I am using AFOAuth1Client in order to Authenticate and then retrieve the Home Timeline of a given Twitter User. However when I run my code I get this error:



Error Domain=AFNetworkingErrorDomain Code=-1011 "Expected status code in (200-299), got 403" UserInfo=0x7fe160ca0070 {NSLocalizedRecoverySuggestion={"errors":[{"message":"Your credentials do not allow access to this resource","code":220}]}, NSErrorFailingURLKey=http://ift.tt/19WaRhi, AFNetworkingOperationFailingURLRequestErrorKey=<NSMutableURLRequest: 0x7fe160ca88c0> { URL: http://ift.tt/19WaRhi }, AFNetworkingOperationFailingURLResponseErrorKey=<NSHTTPURLResponse: 0x7fe160dad9b0> { URL: http://ift.tt/19WaRhi } { status code: 403, headers {
"Content-Encoding" = deflate;
"Content-Length" = 94;
"Content-Type" = "application/json;charset=utf-8";
Date = "Wed, 31 Dec 2014 20:19:49 UTC";
Server = "tsa_b";
"Set-Cookie" = "guest_id=v1%3A142005718900451202; Domain=.twitter.com; Path=/; Expires=Fri, 30-Dec-2016 20:19:49 UTC";
"Strict-Transport-Security" = "max-age=631138519";
"x-connection-hash" = 2a42433adec68c7f4e4410d0df3e6713;
"x-response-time" = 5;
"x-spdy-version" = "3.1-NPN";
} }, NSLocalizedDescription=Expected status code in (200-299), got 403}


Here is how I am attempting to Authenticate:


SettingsViewController.m



- (void)authenticateWithTwitter {
self.twitterClient = [[AFOAuth1Client alloc] initWithBaseURL:[NSURL URLWithString:@"http://ift.tt/nSqRsl"]
key:@"XXXXXXXXXXXX"
secret:@"XXXXXXXXXXXX"];

[self.twitterClient authorizeUsingOAuthWithRequestTokenPath:@"oauth/request_token"
userAuthorizationPath:@"oauth/authorize"
callbackURL:[NSURL URLWithString:@"floadt://success"]
accessTokenPath:@"oauth/access_token"
accessMethod:@"GET"
scope:nil
success:^(AFOAuth1Token *accessToken, id response) {
[AFOAuth1Token storeCredential:accessToken withIdentifier:@"TwitterToken"];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"twitterActive"];
[[NSUserDefaults standardUserDefaults] synchronize];
} failure:^(NSError *error) {
NSLog(@"Error: %@", error);
}];
}


StreamViewController.m



-(void)fetchTweets {
AFOAuth1Token *twitterToken = [AFOAuth1Token retrieveCredentialWithIdentifier:@"TwitterToken"];
[self.twitterClient setAccessToken:twitterToken];

self.twitterClient = [[AFOAuth1Client alloc] initWithBaseURL:[NSURL URLWithString:@"http://ift.tt/YFagLh"] key:@"XXXXXXXXX" secret:@"XXXXXXXXXX"];

[self.twitterClient registerHTTPOperationClass:[AFJSONRequestOperation class]];
[self.twitterClient getPath:@"statuses/home_timeline.json" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSArray *responseArray = (NSArray *)responseObject;
NSLog(@"Response: %@", responseObject);
[responseArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
tweets = responseArray;
}];
[self.tableView reloadData];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
}



Archive submission failed due to info.plist

I encountered two problem while validating my project for it to be submitted to the app store:


enter image description here


The weird thing is that I do have an Info.plist in my project and the other thing is that I don't know what is the CFBundleVersion Key. What am I missing?




I really need help getting my account back

I would just like to know how I can get my Instagram account back, today I attempted to log into my Instagram account, @what_lucy_did, and I was told to log in on a computer, I then followed the steps of entering my details and attaching a photo graph of my I.D but I still have not received my account back. I am extremely irritated as I use Instagram to share photos and messages with a majority of people I can't reach anywhere else. I have a photograph of my I.D which clearly shows that I am old enough to have an Instagram account and that I am who I say I am. Sincerely Lucy Lauder




How create proportionally views with autolayout for different screen sizes?

I have to make a new app where the designer make this type of graphics:


iPhone 4: iPhone 4


iPhone 5: iPhone 5


As you can see in the iPhone 4 I have a smaller header than iPhone 5 (also the subviews like the bird and text and smaller). How can I do this with autolayout? I used the aspect ratio without success :/.




iOS UITextField Auto Resize conform to the content

How I can set the Auto resize in Text Field in iOS ?


helloWorld.m


self.TextFieldExample.text = @"HELLO WORLD HELLO WORLD HELLO WORLD HELLO WORLD";


Now:



HELLO WORLD HELLO ...



Correct:



HELLO WORLD HELLO WORLD HELLO WORLD HELLO WORLD



What is the best practice in this case?




mardi 30 décembre 2014

Custom NSSortDescriptor for NSFetchedResultsController

I have a custom "sort" that I currently perform on a set of data. I now need to perform this sort on the fetchedObjects in the NSFetchedResultsController. All of our table data works hand in hand with core data fetched results so replacing the data source with a generic array has been problematic.


Since NSFetchedResultsController can take NSSortDescriptors it seems like that is the best route. The problem is I don't know how to convert this sort algorithm into an custom comparator.


How do I convert this into a custom comparator (if possible)? (if not how do I get the desired sorted result while using NSFetchedResultsController). In essence the field 'priority' can be either 'high' 'normal' or 'low' and the list needs to be sorted in that order.



+(NSArray*)sortActionItemsByPriority:(NSArray*)listOfActionitemsToSort
{
NSMutableArray *sortedArray = [[NSMutableArray alloc]initWithCapacity:listOfActionitemsToSort.count];
NSMutableArray *highArray = [[NSMutableArray alloc]init];
NSMutableArray *normalArray = [[NSMutableArray alloc]init];
NSMutableArray *lowArray = [[NSMutableArray alloc]init];

for (int x = 0; x < listOfActionitemsToSort.count; x++)
{
ActionItem *item = [listOfActionitemsToSort objectAtIndex:x];

if ([item.priority caseInsensitiveCompare:@"high"] == NSOrderedSame)
[highArray addObject:item];
else if ([item.priority caseInsensitiveCompare:@"normal"] == NSOrderedSame)
[normalArray addObject:item];
else
[lowArray addObject:item];
}

[sortedArray addObjectsFromArray:highArray];
[sortedArray addObjectsFromArray:normalArray];
[sortedArray addObjectsFromArray:lowArray];

return sortedArray;
}



[Iphone Emulator ]Starting from scratch or start using Qemu

I wanna emulate the A6 processor created for the Iphone 5 . And wanna know if shall i start from scratch or start from Qemu source code , or if there is any Emulators that provides some ARMv7 emulation .




Can my iPhone unlock my windows PC

I am looking for an app (either buy or develop) with the following feature - "When I bring my iPhone close to (in bluetooth range) to my windows PC, the PC unlocks by virtue of bluetooth pairing with the iPhone and when it is not in bluetooth range the PC locks". I could not find any such app. Is it because bluetooth 4.0 is not supported by most windows devices or is it because bluetooth iPhone pairing with windows PC is not supported ? There are similar products out there for MAC though (MAC-iphone lock/unlock) like knock or keycard.




Text View Placeholder Swift

I'm making an application which uses a Text View. Now I want the Text View to have a placeholder similar to the one you can set for a Text Field. How would you accomplish this using swift.


Does anyone know how to do this?




Create a checkpoint : xcode [on hold]

Hey guys so in making this app , so I have a problem... I want the app to change the starting point after you pass 10 view controllers ( so when you close out of the app it would start again at the 11th view controller) Is that possible ?


I'm basically asking if you can change the initial view controller in the app , so when you completely close out of the app it starts on the same view controller you left.


To clarify some more, i want to make a checkpoint that once you pass it in the app, if you completely close out of it you would start their




Fetch Core Data entity with a filtered set of child elements based on a property

I'm developing my first application with CoreData and I'm struggling with a common problem I think.


Let's say I have an entity Playlist which has a many to many relationship with another entity Song and also Video. So my Playlist object looks like this



class Playlist : NSManagedObject {
var songs: NSSet
var videos: NSSet
}


Song and Video entities both have a Boolean field "removed" that I use to track which song or video has been removed from the playlist. I later call my remote API to remove it on server's side but this is for offline purpose.


What I want is to retrieve from CoreData a Playlist object with its list of songs and videos that are not removed (so those with removed = false).


One solution I see would be to get all the elements by simply fetching on the Entity Playlist and then filter out manually but I'd like to know if I can do this more elegantly using Core Data.




iCloud UIDocumentPickerViewController is empty on real iPhone 5

I want to use the UIDocumentPickerViewController to select a ".json" file. In the simulator this works fine but not on a real device :(


Image: http://i.imgur.com/bR0cRXn.jpg



@IBAction func btnImport(sender: AnyObject) {
let documentPicker = UIDocumentPickerViewController(documentTypes: [kUTTypeJSON as NSString], inMode: .Import)
documentPicker.delegate = self
presentViewController(documentPicker, animated: true, completion: nil)
}

func documentPicker(controller: UIDocumentPickerViewController,
didPickDocumentAtURL url: NSURL) {
// Do something
println(url)
}



Apple Iphone 6 issue with div id responsive

Apple Iphone 6 issue with div id responsive


I tried to use



<div id="responsive">
Content that is very long in width
</div>


its work for Samsung phone, scrollable left and right to see the content.


But for Iphone 6, the scroll doesn't even appear ( not responsive )


What should I do


I tried added



<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">


at head and it doesn't work.




Objective-c 2 dimension array of objects in class

I am trying to declare a 2d array of objects as a property in a class , but i am receiving an error : array has incomplete element type.



@property RoundObj *rounds[][];



How to take a dump size more than 1024 using LLDB from iOS memory

I am trying to get decrypted binary from my iPhone 5s memory which is x64-bit, I saw couple of tutorials about GDB but unfortunately i cannot use it because i am on arm7 device, i have tried this solution but i get this errors:



(lldb) memory read --outfile /tmp/mem.bin --binary 0x1000 0x2000
error: Normally, 'memory read' will not read over 1024 bytes of data.
error: Please use --force to override this restriction just once.
error: or set target.max-memory-read-size if you will often need a larger limit.


When tried to use --force command i get this error:



(lldb) memory read --outfile /tmp/mem.bin --binary 0x1000 0x2000 --force
error: memory read failed for 0x1000


Then i tried to change the maximum read size but i got another error:



(lldb) set set max-memory-read-size 1000000
error: invalid value path 'max-memory-read-size'
(lldb) set append max-memory-read-size 1000000
error: invalid value path 'max-memory-read-size'


Is there any other way to do it, or maybe i am doing something wrong?




How to set a label's preferredMaxLayoutWidth to automatic programmatically?

I get the following errors when I attempt to set a label's Preferred Width to Automatic in a storyboard:



Attribute Unavailable: Automatic Preferred Max Layout Width is not available on iOS versions prior to 8.0



Since I need my layout to work on both iOS 7 and 8, I was planning to do the following:



  1. Set the value to Explicit in the storyboard.

  2. On iOS 7, set the value to an explicit, computed width programatically.

  3. On iOS 8, set the value to automatic programatically.


1 and 2 are easy. How do I do step 3? Is there a constant I can set it to?




Here's what I have tried so far...


If you set the value to automatic on a storyboard and you inspect preferredMaxLayoutWidth, you will see that it is 0.


However, attempting to set it to 0, even if it says it is already 0, doesn't work properly (e.g. the label stays as a single line). For example, I tried setting the value to automatic in the storyboard, and on viewDidLoad, I ran the following:



self.label.preferredMaxLayoutWidth = self.label.preferredMaxLayoutWidth;


When I don't run the above code, the label is sized properly. However, when I run the above code (which should do nothing), it stays as a single line (undesirable behavior).




The header file for UILabel says:



// Support for constraint-based layout (auto layout)
// If nonzero, this is used when determining -intrinsicContentSize for multiline labels
@property(nonatomic) CGFloat preferredMaxLayoutWidth NS_AVAILABLE_IOS(6_0);


As far as a constant, I couldn't find anything. The closest constant I can think of to what I want is UITableViewAutomaticDimension, which doesn't work.


Here is what the storyboard looks like....


Automatic layout width:



<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="1000" text="Foo" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Bis-iG-g4l">
<rect key="frame" x="20" y="116" width="560" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>


Explicit layout width:



<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="1000" text="Foo" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="560" translatesAutoresizingMaskIntoConstraints="NO" id="Bis-iG-g4l">
<rect key="frame" x="20" y="116" width="560" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>


The only difference is that the latter has:



preferredMaxLayoutWidth="560"



Bleached iphone screen [on hold]

I noticed this behavior of Iphone display and I would like to ask you if your Iphone does the same, and what is the cause. When I watch dark video on Iphone, and immediately press home button to switch to bright homescreen, interesting thing happens. All the pixels are "bleached" and after few seconds they retain their original colors. I would like to know if this is software or hardware "thing", since it does not happen when I switch from dark picture to bright homescreen. Could it be that by running dark CPU-consuming apps like videos, the OS is slow to adapt to high brightnes, and "forgets" to turn down voltage to the screen? (like an eye going from dark to bright place) Please try it yourself, ( record short dark video, and then press homebutton to get to the bright homescreen) and tell me if you know the cause.


Edit: it's not inherent "software" bug, because when I printscreen the bleached screen, the colours are as they should be, so it's probably that OS forgets to lower the voltage to the screeen or (---)?




Logout of Social Networks from iOS application

In my app i am using google, face book login .I was able to login properly but when i try to logout from google , face book i am using following code.But my problem is even if i logout from my app When i click on login buttons it is asking permissions not login screen.Even if i logout from my app, Do i need to logout in safari browser (clear cookies in settings) or device social apps.


What to do to complete logout from app it self.



[[GPPSignIn sharedInstance] signOut];


//facebook


FBSession* session = [FBSession activeSession];


[session closeAndClearTokenInformation];


[session close];


[FBSession setActiveSession:nil];


NSHTTPCookieStorage* cookies = [NSHTTPCookieStorage sharedHTTPCookieStorage];


NSArray* facebookCookies = [cookies cookiesForURL:[NSURL URLWithString:@"https://facebook.com/"]];


for (NSHTTPCookie* cookie in facebookCookies) {



[cookies deleteCookie:cookie];


}




Troubleshooting Custom UITableView Cell [Swift]

I have created a custom UITableView cell in my Storyboard that looks like this:


enter image description here


I hooked it up to my UITableViewCell class like this:


import UIKit



class StatusCell: UITableViewCell {

@IBOutlet weak var InstrumentImage: UIImageView!

@IBOutlet weak var InstrumentType: UILabel!

@IBOutlet weak var InstrumentValue: UILabel!

override func awakeFromNib() {
super.awakeFromNib()
}

override func setSelected(selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
}
}


Finally I attempted to initialize the UITableView from my UIViewController as such:



import UIKit

class SecondViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {

@IBOutlet weak var TableView: UITableView!

let Items = ["Altitude","Distance","Groundspeed"]

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.Items.count
}

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

var cell: StatusCell! = tableView.dequeueReusableCellWithIdentifier("Cell") as StatusCell!

cell.InstrumentType?.text = Items[indexPath.row]
cell.InstrumentValue?.text = "150 Km"
cell.InstrumentImage?.image = UIImage(named: Items[indexPath.row])
return cell
}

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}

}


However, when I attempt to run the program I get an EXC_BAD_INSTRUCTION error:


enter image description here


What could I have done wrong? Any help would be appreciated!




Xcode 6 Swift - Displaying a local PDF

I wanted to be able to display a local PDF in my app but couldn't find an effective method to do so. I have already tried creating a Webview and downloading the PDF each time the app runs, but I would like for the app to display a local version. I found multiple tutorials on YouTube, however, they were all in Objective-C. Here are the links (in objective-c) of something similar to what I'm trying to do:


https://www.youtube.com/watch?v=TtKoddECri0&spfreload=10 https://www.youtube.com/watch?v=lgu8HbTsY1M


I'm new to programming in general, so it would be great if your steps would be as detailed as possible. Thanks in advance.




coredata NSFetchRequest one to many relationship Relationship fault on managed object

I have a coredata project with the following entities:


I'm trying to get the list of the content base on the category:


here is my coredata clasess .h:



@interface Content : NSManagedObject

@property (nonatomic, retain) NSString * contenido;
@property (nonatomic, retain) NSNumber * index;
@property (nonatomic, retain) NSString * titulo;
@property (nonatomic, retain) NSNumber * uploadCloudKit;
@property (nonatomic, retain) Categories *category;

---

@class Content;

@interface Categories : NSManagedObject

@property (nonatomic, retain) NSString * categoryName;
@property (nonatomic, retain) NSSet *content;
@end



NSEntityDescription *categoryDescription = [ NSEntityDescription entityForName:@"Categories" inManagedObjectContext:moc];

NSFetchRequest *categoRequest = [NSFetchRequest new];
categoRequest.entity = categoryDescription;
NSPredicate *categoPredicate = [NSPredicate predicateWithFormat:@"categoryName like %@", category];
categoRequest.predicate = categoPredicate;
NSArray *results = [moc executeFetchRequest:categoRequest error:&error];


but when I try to access the content on the result for the category I get:



po [results valueForKey:@"content"]
<__NSArrayI 0x6080000243a0>(
Relationship 'content' fault on managed object (0x6080000a2220) <Categories: 0x6080000a2220> (entity: Categories; id: 0x40002b <x-coredata://FDBA3FB2-F1F8-498E-9071-3A5D1ABE66F0/Categories/p1> ; data: {
categoryName = movies;
content = "<relationship fault: 0x610000030fa0 'content'>";
})
)


Any of you knows how can I get the content items of the result?


I'll really appreciate your help




How to increase the volume of iOS app playing generated PCM audio?

I have a lot of experience writing embedded software on a variety of platforms and in a variety of languages, but this is my first iOS app.


This app emits audio data. The data is different each time, and must be generated by the app on-the-fly. It is encoded as 500Hz modulated PCM on a 12kHz carrier, lasting less than 100mS. The volume of the data must be independent of the system volume.


All is working well, except that the volume of the data through the speaker is very low on most iPhones. Through the receiver it is even worse, to the point of being unusable. The volume on an iPad seems better.


Sadly, I don't have many physical iPhones to try this out on.


I chose to use the AudioUnits API because it is most compatible with PCM data. An array of Float32 is populated with data sampled at 32kHz. The 12kHz carrier data varies from +1.0 to -1.0 at full volume, and is scaled down for lower volumes if the user desires.


Here are some code snippets to examine. There's nothing very exotic here, but maybe someone can point out what I am doing wrong. I am omitting much of the structure and the iOS app-specific code, since I'm not having problems there. Note also that there is more error-checking done than I have shown here, in the interest of brevity:



typedef Float32 SampleType;
AURenderCallbackStruct renderCallbackStruct;
AVAudioSession * session;
AudioComponentInstance audioUnit;
AudioComponentDescription audioComponentDescription;
AudioStreamBasicDescription audioStreamBasicDesc;
UISlider IBOutlet * volumeViewSlider;

static SampleType * generatedAudioData; // Array to hold
// generated audio data

...

// Description to use to find the default playback output unit:
audioComponentDescription.componentType = kAudioUnitType_Output;
audioComponentDescription.componentSubType = kAudioUnitSubType_RemoteIO;
audioComponentDescription.componentManufacturer = kAudioUnitManufacturer_Apple;
audioComponentDescription.componentFlags = 0; // Docs say: "Set this value to zero."
audioComponentDescription.componentFlagsMask = 0; // Docs say: "Set this value to zero."

// Callback structure to use for setting up the audio unit:
renderCallbackStruct.inputProc = RenderCallback;
renderCallbackStruct.inputProcRefCon = (__bridge void *)( self );

// Set the format for the audio stream in the AudioStreamBasicDescription (ASBD):
audioStreamBasicDesc.mBitsPerChannel = BITS_PER_BYTE * BYTES_PER_SAMPLE; // (8 * sizeof ( SampleType ))
audioStreamBasicDesc.mBytesPerFrame = BYTES_PER_SAMPLE;
audioStreamBasicDesc.mBytesPerPacket = BYTES_PER_SAMPLE;
audioStreamBasicDesc.mChannelsPerFrame = MONO_CHANNELS; // 1
audioStreamBasicDesc.mFormatFlags = (kAudioFormatFlagIsFloat |
kAudioFormatFlagsNativeEndian |
kAudioFormatFlagIsPacked |
kAudioFormatFlagIsNonInterleaved);
audioStreamBasicDesc.mFormatID = kAudioFormatLinearPCM;
audioStreamBasicDesc.mFramesPerPacket = 1;
audioStreamBasicDesc.mReserved = 0;
audioStreamBasicDesc.mSampleRate = 32000;

session = [AVAudioSession sharedInstance];
[session setActive: YES error: &sessionError];
// This figures out which UISlider subview in the MPVolumeViews controls the master volume.
// Later, this is manipulated to set the volume to max temporarily so that the AudioUnit can
// play the data at the user's desired volume.
MPVolumeView * volumeView = [[MPVolumeView alloc] init];
for ( UIView *view in [volumeView subviews] )
{
if ([view.class.description isEqualToString:@"MPVolumeSlider"])
{
volumeViewSlider = ( UISlider * ) view;
break;
}
}

...

// (This is freed later:)
generatedAudioData = (SampleType *) malloc ( lengthOfAudioData * sizeof ( SampleType ));

[session setCategory: AVAudioSessionCategoryPlayAndRecord
withOptions: AVAudioSessionCategoryOptionDuckOthers |
AudioSessionOverrideAudioRoute_Speaker
error: &sessionError];
// Set the master volume to max temporarily so that the AudioUnit can
// play the data at the user's desired volume:
oldVolume = volumeViewSlider.value; // (This is set back after the data is played)
[volumeViewSlider setValue: 1.0f animated: NO];

AudioComponent defaultOutput = AudioComponentFindNext ( NULL, &audioComponentDescription );

// Create a new unit based on this to use for output
AudioComponentInstanceNew ( defaultOutput, &audioUnit );

UInt32 enableOutput = 1;
AudioUnitElement outputBus = 0;
// Enable IO for playback
AudioUnitSetProperty ( audioUnit,
kAudioOutputUnitProperty_EnableIO,
kAudioUnitScope_Output,
outputBus,
&enableOutput,
sizeof ( enableOutput ) );

// Set the audio data stream formats:
AudioUnitSetProperty ( audioUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input,
outputBus,
&audioStreamBasicDesc,
sizeof ( AudioStreamBasicDescription ) );

// Set the function to be called each time more input data is needed by the unit:
AudioUnitSetProperty ( audioUnit,
kAudioUnitProperty_SetRenderCallback,
kAudioUnitScope_Global,
outputBus,
&renderCallbackStruct,
sizeof ( renderCallbackStruct ) );

// Because the iPhone plays audio through the receiver by default,
// it is necessary to override the output if the user prefers to
// play through the speaker:
// (if-then code removed for brevity)
[session overrideOutputAudioPort: AVAudioSessionPortOverrideSpeaker
error: &overrideError];
// The pcmEncoder fills generatedAudioData with the ... uh, well,
// the generated audio data:
[pcmEncoder createAudioData: generatedAudioData
audioDataSize: lengthOfAudioData];
AudioUnitInitialize ( audioUnit );
AudioOutputUnitStart ( audioUnit );

...

///////////////////////////////////////////////////////////////
OSStatus RenderCallback ( void * inRefCon,
AudioUnitRenderActionFlags * ioActionFlags,
const AudioTimeStamp * inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList * ioData)
{
SampleType * ioDataBuffer = (SampleType *)ioData->mBuffers[0].mData;

// Check that the data has been exhausted, and if so, tear down the audio unit:
if ( dataLeftToCopy <= 0 )
{ // Tear down the audio unit on the main thread instead of this thread:
[audioController performSelectorOnMainThread: @selector ( tearDownAudioUnit )
withObject: nil
waitUntilDone: NO];
return noErr;
}
// Otherwise, copy the PCM data from generatedAudioData to ioDataBuffer and update the index
// of source data.

... (Boring code that copies data omitted)

return noErr;
}

///////////////////////////////////////////////////////////////
- (void) tearDownAudioUnit
{
if ( audioUnit )
{
AudioOutputUnitStop ( audioUnit );
AudioUnitUninitialize ( audioUnit );
AudioComponentInstanceDispose ( audioUnit );
audioUnit = nil;
}
// Change the session override back to play through the default output stream:
NSError * deactivationError = nil;
int errorInt = [session overrideOutputAudioPort: AVAudioSessionPortOverrideNone
error: &deactivationError];
// Free the audio data memory:
if ( generatedAudioData ) { free ( generatedAudioData ); generatedAudioData = nil; }
[volumeViewSlider setValue: oldVolume animated: NO];
}


Manipulating the volume slider only seems to be necessary on the iPad, but it doesn't hurt on the iPhone, as far as I can tell.

Using different data types (SInt32, int16_t) for SampleType doesn't seem to make a difference.

Scaling the data greater than the range +1.0 to -1.0 only seems to result in clipping.


Would using a different API such as AudioServicesPlaySystemSound or AVAudioPlayer result in louder output? They each present challenges, and I'm loath to implement them without some indication that it would help.

(My understanding is that I'd have to create a .caf container 'file' each time data is generated so that I can pass a URL to these APIs, then delete it after it is played. I haven't seen an example of this particular scenario; maybe there's an easier way? ... but that's a different question.)


Is the typical iPhone's speaker and receiver just not capable of pumping 12kHz out at a usable volume? I find that hard to believe.


Thanks in advance for any help!




dismissing GLKViewController does not free memory

I got a question to ask. Currently, dismissing GLKViewController is not deallocating the memory at all. Rather, it takes more memory whenever I move to the GLKViewController and dismiss it. My game starts at 100MB. Whenever I play a game, it adds up about 10MB. So, if I play it 10 times, it will be about 200MB in the end. It will crash eventually.


This is my only reference to the GLKViewController. I do not call it anywhere in my uiviewcontroller anywhere other than that. I use modal segue to move to glkviewcontroller.


- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { Game *renderer = [segue destinationViewController]; [renderer setDelegate:self]; renderer.bomb = bomb; }


And I dismiss it using [self dismissViewControllerAnimated:YES completion:nil]


Do you know how to fix this problem? It is wasting so much time right now. Thanks.




how to make add see more featues in UILable if length of string is more than the number of line display in lable?

i count the require lable size using below code



CGSize expectedLabelSize = [text sizeWithFont:instructions.font
constrainedToSize:instructions.frame.size
lineBreakMode:UILineBreakModeWordWrap];


i count the number ofline of lable using below code



int numberofline = ceil(lable.frame.size.height / font.lineHeight);


in my case i require only 3 line on the button click the hole text display in tableview...due to modifing the cell height...


//please help me to check how to get number of characters for given font family....


![this is demo image][1] see image on following link [click to view image demo][1]




iAd banner position is wrong on iPhone 6/6 Plus

I'm trying to optimize my SpriteKit App for iPhone 6 and iPhone 6 Plus but the iAd banner position is wrong and I can't change it. It works great on 4" or 3.5" iPhones but on iPhone 6 and 6 Plus the banner isn't at the bottom, it is a bit above it.


Also, I've been searching for this problem in google. There were many solutions but none of them worked for me.


I'm using following code for the iAd banner in my ViewController.m file:



//iAd
#pragma mark iAd Delegate Methods

- (void)bannerViewDidLoadAd:(ADBannerView *)banner
{
CGRect screen = [[UIScreen mainScreen] bounds];
CGFloat height = CGRectGetHeight(screen);

banner.frame = CGRectOffset(banner.frame, 0, height-banner.frame.size.height);
//Changing the Y-position doesn't change the banner's position

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];

if([[NSUserDefaults standardUserDefaults] boolForKey:@"Ads_savedata"] == NO)
[banner setAlpha:0];
else
[banner setAlpha:1];

[banner updateConstraints];
[UIView commitAnimations];
}

- (void) bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
[banner setAlpha:0];
[UIView commitAnimations];
}


I hope someone can help me with that problem. Thanks for your attention.




how to create a instance of objective-c class by name?

I want get somethine like:



#define weaken(object) ...

----

ClassABCD * abcd = [ClassABCD new];
weaken(abcd);
weakAbcd.tag = 0;

----


i have some code below:



#define weaken(x) __weak typeof(x) weak##x = x


but it only can use like "weakabcd" . not "weakAbcd"...




Create IPA with symbols using xcrun

I noticed a different when creating an .ipa file manually using xcrun than exporting it from xcode. The xcrun version doesn't have any symbols included with the .ipa.


I was wondering what's the best way to create an .ipa with symbols (no reason not to send them) manually from the command line, I'm using TeamCity CI to generate our production .ipa files.


I use the following command line to generate the IPA -



/usr/bin/xcrun -sdk iphoneos PackageApplication -v "DerivedData/MyApp/Build/Products/Release-iphoneos/MyApp.app" -o "~/MyApp.ipa" --sign "<HIDDEN>" --embed "<HIDDEN>"


I run it after invoking xcodebuild so the Release-iphoneos folder got the latest release version of my app.


Thanks,

Nimrod




Android and iOS preferences and unique identifier

I am planning on storing a unique identifier after a user logs in for the first time on an Android and Apple app. This will make sure that the user can only access data from one device if they try to login through another device as I will flag then as having access. I will save this unique identifier in the devices preferences and use it for requests to get this private data.


With that being said I know the preferences can be deleted or removed. This piece of data isnt needed long term and in emergencies we can reset the users account back as if they never got access yet like for a factory reset or deleted app.


My question is, are there any issues with this? These arent developers so somehow getting access to the user preferences to find that unique identifier and using it elsewhere shouldnt be an issue.




Screenshort plugin in phonegap not working in iphone [on hold]

Screenshot plugin in phonegap not showing images in camera role in device it shows some default path/private/v**/cont****/data/**/***/temp/screenshot_56432.jpg. but images not appear in camera role. i am using this plugin in my config file cordova plugin add https://github.com/gitawego/cordova-screenshot.git github url https://github.com/gitawego/cordova-screenshot/tree/master/src/ios


How i am change the path temp to camera role.I need to see the images in camera role.




using Objective - C make own sidebar in iOS [on hold]

how to make own sidebar in iOS - please describe it in step by step. bcz I'm a beginner in iOS.


Pls, not tell me to use MFSlide bar or etc.




Build Iphone 64 bit application using Rhomobile 5

Does anyone knows how to build iphone 64 bit application using Rhomobile 5, rhodes-5.0.2 to be exact. I'm using mac with Yosemite 10.10 os and xcode 6. I build for ios 8.1.


Thanks




condition for loading storyboard for iphone 6 without autolayout

is it work for iphone 6 in potrait view without autolayout?



CGRect screenBounds = [[UIScreen mainScreen] bounds];
if (screenBounds.size.height >= 568) {
// code for iphone5 and iphone 6 is it work for different frame etc set?
}
else {
// code for iphone4
}



Show UINavigationBar From AppDelegate

I have an app that allows the user to hide/show the UINavigationBar on the main screen. The navigation bar can be toggled whenever the user touches the screen twice with two fingers, but if the user closes out of the app with the navigation bar gone, and they open it back up again and forgot what they were doing, the user is "left in the dark" on what to do next. It's not obvious that the navigation bar is hidden, and it's especially not obvious on how to get it back. So my question is how can I use AppDelegate.m's



- (void)applicationDidBecomeActive:(UIApplication *)application


method to regain visibility of the navigation bar. I've tried just about everything I could thing of from class methods to passing parameters.




Strange screens in iPhone5s 7.1 simulator

I have xcode 6 and target is 7.0.I am having no problem with other simulators.But in iPhone5s7.1 the screen has black top bar and bottom barenter image description here




ios8 currency Symobol has Country Code in front

I am trying to get a currency symbol from the locale, but seems in IOS8 the currencySymbol returned is US$ instead of $. anyone knows what changed?


Thanks,



NSLocale *lcl = [NSLocale currentLocale];
NSNumberFormatter *fmtr = [[NSNumberFormatter alloc] init];
[fmtr setNumberStyle:NSNumberFormatterCurrencyStyle];
[fmtr setLocale:lcl];

NSLog( @"%@", [fmtr internationalCurrencySymbol] );
NSLog( @"%@", [fmtr currencySymbol] );


2014-12-30 00:11:35.617[1344:424347] USD 2014-12-30 00:11:35.617[1344:424347] US$




Impact on app ranking when transferring application to a different market account

There is an application whose ownership we want transferred from one account to another account where both the (from and to) accounts belong to different markets. Could you confirm me if their would be any negative impact on the app ranking because we have heard that when you publish an app with an account of the sam market where you are publishing. the app will have better ranking rather than publishing it from an account of of other market. Could you confirm me if this is true for android and/or iOS applications. Thanks!




Ical with password and username

I want to create an iCal Calendar (I guess ical4j is a good lib for it?). I want to save this ical - File on my webserver.


After that the ical calendar is available over the internet. Now I want to sync this calendar to my phone (e.g.iPhone). But I want to have an authentification for this iCal calendar.


Is this possible? How can I do this?


Best Regards




lundi 29 décembre 2014

Gstreamer does not play multiple streams at a time

I am working on an app which requires to play multiple RTSP streams at a time using Gstreamer , it is working fine with single stream , as i add second stream , first stream stops and second starts to play , after few sconds , it also stops and app crashes.


Here is screenshot of APP streams view APP screenview


and this screenshot when APP crashes


app crash screen


i have updates the Gstreamer.framework , searched and tried different solutions.but nothing worked


Here is my code sample for pipelining the streams



#import "VideoViewController.h"
#import "GStreamerBackend.h"
#import <UIKit/UIKit.h>

@interface VideoViewController () {
GStreamerBackend *gst_backend;
GStreamerBackend *gst_backend1;
int media_width; /* Width of the clip */
int media_height; /* height ofthe clip */
Boolean dragging_slider; /* Whether the time slider is being dragged or not */
Boolean is_local_media; /* Whether this clip is stored locally or is being streamed */
Boolean is_playing_desired; /* Whether the user asked to go to PLAYING */
}


in viewDidLoad:



url1= my first url
url2=my second URL


here I initialize my 2 stream.



gst_backend = [[GStreamerBackend alloc] init:self videoView:video_view];

gst_backend1 = [[GStreamerBackend alloc] init:self videoView:video_view1];


this delegate method is called :



-(void) gstreamerInitialized
{

dispatch_async(dispatch_get_main_queue(), ^{
firstInit=YES;
play_button.enabled = TRUE;
pause_button.enabled = TRUE;
message_label.text = @"Ready";
[gst_backend setUri:uri];
[gst_backend1 setUri:uri2];
//is_local_media = [uri hasPrefix:@"file://"];
//is_playing_desired = NO;

[gst_backend1 play];
[gst_backend play];
});

}


i think issue is in the search paths. enter image description here


enter image description here