• victor92
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 4
    Replies

I'm making a request For create with object type, and i have this exception 'Invalid type in JSON write (UIDeviceWhiteColor)' i really don't know what it means, i will be appreciated if someone know this error or tell me why its happening

I`m not an expert in objective c programming, im doing a native app with the SDK for xcode, the problem is that i want to pass data back between view controllers.

I have an atributte in a child controller that i want to pass to another atributte in the parent controller, im using protocols and it supposed that my app will be working, but it doesnt.

Someone know if the SDK don`t allow this kind of things, or any idea?

I have sent 2 querys in the same viewController. So I will be getting to the "- (void)request:(SFRestRequest *)request didLoadResponse:(id)jsonResponse" twice. So how can I distinguish 2 requests ??

Im new on this of the SDK of salesforce for Xcode, i want know how can i access to the attributtes of a record, because the code that i have is just if i have a table, but if i don´t havent i try to pass the object of the record to a NSDictionary variable, but it didn´t work.

In a easy way to explain, i just want to put the object that i bring with a requestForQuery in a nsdictionary object, or in something similar. Thanks!

I am making a mobile app in xcode, how i understand i need to make the security review at the end but i have see that in web applications there is a process called source scanner, i want to know if i can make those source scanner of my mobile app?

I want know if its possible to download or to make a visor of objects attachments of my cloud in my native applicacion in xcode

It`s possible to synchronize my native xcode app with the object event to create a calendar in my app?

I make an app in xcode using the mobile salesforce SDK, but i dont know if salesforce make the security review or apple do it, or if are both. I will appreciate some information about that

I want to make a log out button in a native xcode app, i use this for make the log out

SFNativeRestAppDelegate *sf=[[SFNativeRestAppDelegate alloc] init];

[sf.coordinator revokeAuthentication];
[sf.coordinator authenticate];

The problem is that it porduces an exception that say`s

[SFNativeRestAppDelegate oauthRedirectURI]: unrecognized selector sent to instance 0x869ae10'

 My code of this method in the class SFNativeRestApp delegate is the next:

 - (NSString*)oauthRedirectURI {
    NSLog(@"You must override this method in your subclass1");
    [self doesNotRecognizeSelector:@selector(oauthRedirectURI)];
    return nil;}

 

I expect someone could help me, im new in this and i really don`t understand very good what this method is doing.

final=[datepicker date];
    NSLog(inicio.description);
    NSLog(final.description);
    NSDateFormatter *formatter;
    formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.000'Z'"];
    NSString *inicioformat=[formatter stringFromDate:inicio];
    NSString *finalformat=[formatter stringFromDate:final];
    if([self.inicio.description isEqualToString:self.final.description]){
        UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"Falla en las fechas"
                                                          message:@"La fecha y tiempo inicial no pueden ser el mismo que la fecha e inicio final"
                                                         delegate:nil
                                                cancelButtonTitle:@"OK"
                                                otherButtonTitles:nil];
    }
    else {
    NSArray *keys2=[[NSArray alloc]initWithObjects:@"WhatId",@"StartDateTime",@"EndDateTime",@"Description", nil];
    //NSArray *objs2=[[NSArray alloc]initWithObjects:whoid,inicio.description,final.description, descripcion.text,nil];
    NSArray *objs2=[[NSArray alloc]initWithObjects:whoid,inicioformat,finalformat, descripcion.text,nil];
        NSString *objectType = @"Event";
    NSDictionary *fields=[[NSDictionary alloc] initWithObjects:objs2 forKeys:keys2];
    SFRestRequest *request = [[SFRestAPI sharedInstance] requestForCreateWithObjectType:objectType fields:fields];
    [[SFRestAPI sharedInstance] send:request delegate:self];
    }

 

My problem is that when i check the event in the cloud, the app publish the even with early five hours of difference, the modification hour and date is correct, so its obvious that the cloud have the correct data, i expect someone could help me.

Hi, i really don`t know how to log out of my account in a native app with xcode, i expect someone could help me

There is an error when i try to sent this sql sentence:

cadena=@"SELECT Name,Description,ParentId FROM Attachment WHERE ParentId=:'%@'",parentId;

 

This is the error unexpected token: ':' (Bind variables only allowed in Apex code), errorCode=MALFORMED_QUERY}
2012-06-29 09:12:38.730 PruebaFinal[2782:fb03] request:didFailLoadWithError: Error Domain=com.salesforce.RestAPI.ErrorDomain Code=999 "The operation couldn’t be completed. (com.salesforce.RestAPI.ErrorDomain error 999.)" UserInfo=0x6c79ff0 {message=
FROM Attachment WHERE ParentId=:'%@'

I expect that someone can help me.

#import "TableViewController.h"
#import "SFRestAPI.h"
#import "SFRestRequest.h"

@interface TableViewController ()

@end

@implementation TableViewController
@synthesize dataRows;

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.title=@"Notas";
    NSString *cadena;
    cadena=@"SELECT Name,Description,Id FROM Attachment WHERE ParentId='a04d0000002FaPC'";
    SFRestRequest *request=[[SFRestAPI sharedInstance] requestForQuery:cadena];
     [[SFRestAPI sharedInstance] send:request delegate:self];
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
 
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;

}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
#pragma mark - SFRestAPIDelegate

- (void)request:(SFRestRequest *)request didLoadResponse:(id)jsonResponse {
    NSArray *records = [jsonResponse objectForKey:@"records"];
    NSLog(@"request:didLoadResponse: #records: %d", records.count);
    self.dataRows = records;
    [self.tableView reloadData];
}

- (void)request:(SFRestRequest*)request didFailLoadWithError:(NSError*)error {
    NSLog(@"request:didFailLoadWithError: %@", error);
    //add your failed error handling here
}

- (void)requestDidCancelLoad:(SFRestRequest *)request {
    NSLog(@"requestDidCancelLoad: %@", request);
    //add your failed error handling here
}

- (void)requestDidTimeout:(SFRestRequest *)request {
    NSLog(@"requestDidTimeout: %@", request);
    //add your failed error handling here
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{

    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    return [self.dataRows count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView_ cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"CellIdentifier";
    UITableViewCell *cell = [tableView_ dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        
    }
	//if you want to add an image to your cell, here's how
	UIImage *image = [UIImage imageNamed:@"icon.png"];
	cell.imageView.image = image;
    
	// Configure the cell to show the data.
	NSDictionary *obj = [dataRows objectAtIndex:indexPath.row];
    //NSString *notas=@"Hola";
	cell.textLabel.text =  [obj objectForKey:@"Name"];
    //cell.text=@"nota1";
	//this adds the arrow to the right hand side.
    cell.textLabel.text=notas;
	cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    
	return cell;
}

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
    }   
    else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSDictionary *obj=[dataRows objectAtIndex:indexPath.row];
   
}

@end



#import <UIKit/UIKit.h>

@interface TableViewController : UITableViewController{
    NSMutableArray *dataRows;
    IBOutlet UITableView *tableView;
}

@property (nonatomic, retain) NSArray *dataRows;
@end

 The function of table view controller is to show in a table view the names or the titles of the atachments that have a specific Parent Id, when i build it all is correct, there is no exception and the sql bring to me 7 records that is correct, the only problem is that the table view don`t show anything. I will aprreciate your help.

I can´t find a useful documentation for the sales force REST API for native applications, i will appreciate if someone could help me with some information.

I work with native applications in xcode with the SDK, but i can only acces to the atribbute Name of my object, when i try to access to another one the value that takes

the container (label,textview) is null. Why?

I`m programming in Xcode with the mobile force SDK, and in the example apps i can see the users of my account, but i don´t know how to join or to get

the info of that users. I´m really  learning to do this, i will be appreciate if you give to me some manuals or tutorials to make this more easy to me.

I don`t know how to work in a storyboard mode in xcode, because when i choose the option of native force by default the validation view is a .xib,

so i don`t know how can i do to join that .xib to another views or how can i do to integrate  in a storyboard, i will be aprecciate your help or if someone

can send me some manuals, tutorials or documents that include something that i can use.

I am making a mobile app in xcode, how i understand i need to make the security review at the end but i have see that in web applications there is a process called source scanner, i want to know if i can make those source scanner of my mobile app?

I want know if its possible to download or to make a visor of objects attachments of my cloud in my native applicacion in xcode

I want to make a log out button in a native xcode app, i use this for make the log out

SFNativeRestAppDelegate *sf=[[SFNativeRestAppDelegate alloc] init];

[sf.coordinator revokeAuthentication];
[sf.coordinator authenticate];

The problem is that it porduces an exception that say`s

[SFNativeRestAppDelegate oauthRedirectURI]: unrecognized selector sent to instance 0x869ae10'

 My code of this method in the class SFNativeRestApp delegate is the next:

 - (NSString*)oauthRedirectURI {
    NSLog(@"You must override this method in your subclass1");
    [self doesNotRecognizeSelector:@selector(oauthRedirectURI)];
    return nil;}

 

I expect someone could help me, im new in this and i really don`t understand very good what this method is doing.

Hi, i really don`t know how to log out of my account in a native app with xcode, i expect someone could help me