he conseguido un iphone

Re: he conseguido un iphone

Postby mastintin » Thu Dec 23, 2010 7:36 pm

mag071 wrote:Saludos y Aprovechar para felicitar en esta navidad a todos y que este 2011 que se acerca les traiga mucha salud.

Sigo sin poder Cambiar el simulador. Sera que debería instalar otra cosa en el xCode.
o al instalar el xCode el me hizo la instalación del SDK.
como Instalo el SDK 4.2.?
no me sale por ningún lado iPhone.

Es la Instalación del sdk del simulador ultima versión 4.2 hecha por separada, yo solo instale el xCode que viene en los discos de la mini.

Gracias por su tiempo.


En teoria la instalacion de xcode desde los discos te instala los sdk de macosx , pero no tengo claro si coloca los de iphone ...
En Developper/Plataforms tienen qwue aparecerte tres carpetas una de macosx otra de iphone y otras del iphonesimulator . Sino es asi .Vete a http://Developer/apple y descargatelo ( ios developer ) es gratis .
Saludos.
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Postby mastintin » Thu Dec 23, 2010 7:47 pm

pgfdz wrote:Como se enlazan las acciones desde el Interface Builder a los botones, pongamos por caso?
Gracias

Mientras Antonio prepara su desarrollo y noas sorprende a todos , la manera de funcionar con Interface builder es la siguiente .
Se genera un archivo nib con la pantalla con Interface builder ( sin crear ni enlazar outles ) en las propiedades de cada objeto tenemos una propiedad Tag que para nosotros equivale al id de los recursos windows.
Gracias a ese tag traemos del archivo nib los objetos , con todas sus propiedades asignadas y los asignamos a objetos "fivephone" , despues ya podemos desde el codigo asignarles las acciones :
por ejemplo :

en el codigo de abajo traemos el view que se encuentra en el nib llamado "hola.nib"
Asignamos a obtn el objeto boton que está dentro de ese view con el TAG que pone 3
y ahora ya podemos seguir como si fuese un objeto Button asignado por codigo , pudiendo usar todos sus metodos y datas ...

Code: Select all  Expand view

local oView:=tView():resources(ownd,"Hola")
local oBtn:=tbutton():resources(oView,3)
       obtn:bAction:= {||   msginfo("accion")   }


 
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Postby pgfdz » Thu Dec 23, 2010 9:15 pm

Muchas gracias, y muy interesante.
Paco García
pgfdz
 
Posts: 145
Joined: Wed Nov 03, 2010 9:16 am

Re: he conseguido un iphone

Postby mastintin » Thu Dec 23, 2010 9:57 pm

pgfdz wrote:Muchas gracias, y muy interesante.

Estoy subiendo un videotutorial a youtube con un ejemplo de uso .

----------- edito ---------------------
enlace al tutorial http://www.youtube.com/watch?v=k0ZdY0tQBvs
Last edited by mastintin on Thu Dec 23, 2010 10:41 pm, edited 1 time in total.
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Postby pgfdz » Thu Dec 23, 2010 10:12 pm

Si puedes incluir como poner una imagen en UIImageView (creo que se llama) desde el Interface Builder, pues bien
Paco García
pgfdz
 
Posts: 145
Joined: Wed Nov 03, 2010 9:16 am

Re: he conseguido un iphone

Postby pgfdz » Thu Dec 23, 2010 10:18 pm

mastintin wrote:
pgfdz wrote:DBUSEAREA( .t., ,AppPath()+ "/ruta.dbf" , "rutas")
ERROR

[Session started at 2010-12-23 19:50:45 +0100.]
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
stat$INODE64 called from function s_fileExtOpen in image Tutor02.
If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first.

Te envio la nueva librería que en teoría ya resuelve el problema . Cambiala y miramos a ver si funciona...
http://rapidshare.com/files/438930423/libfivephone.a
Saludos.


Se queda colgado y pone en la consola todo el rato:

2010-12-23 23:17:45.929 Tutor02[5874:207] stat
2010-12-23 23:17:45.930 Tutor02[5874:207] open
2010-12-23 23:17:45.931 Tutor02[5874:207] stat
2010-12-23 23:17:45.931 Tutor02[5874:207] open

Ahora he hecho el create en el apppath y luego el use y me sale:


[Session started at 2010-12-23 23:26:42 +0100.]
2010-12-23 23:26:43.515 Tutor02[5970:207] stat
2010-12-23 23:26:43.517 Tutor02[5970:207] open
2010-12-23 23:26:43.518 Tutor02[5970:207] fcntl
2010-12-23 23:26:43.518 Tutor02[5970:207] fstat
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
pwrite$UNIX2003 called from function hb_fsWriteAt in image Tutor02.
If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first.
Paco García
pgfdz
 
Posts: 145
Joined: Wed Nov 03, 2010 9:16 am

Re: he conseguido un iphone

Postby mastintin » Thu Dec 23, 2010 10:45 pm

pgfdz wrote:
mastintin wrote:
pgfdz wrote:DBUSEAREA( .t., ,AppPath()+ "/ruta.dbf" , "rutas")
ERROR

[Session started at 2010-12-23 19:50:45 +0100.]
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
stat$INODE64 called from function s_fileExtOpen in image Tutor02.
If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first.

Te envio la nueva librería que en teoría ya resuelve el problema . Cambiala y miramos a ver si funciona...
http://rapidshare.com/files/438930423/libfivephone.a
Saludos.


Se queda colgado y pone en la consola todo el rato:

2010-12-23 23:17:45.929 Tutor02[5874:207] stat
2010-12-23 23:17:45.930 Tutor02[5874:207] open
2010-12-23 23:17:45.931 Tutor02[5874:207] stat
2010-12-23 23:17:45.931 Tutor02[5874:207] open

Ahora he hecho el create en el apppath y luego el use y me sale:


[Session started at 2010-12-23 23:26:42 +0100.]
2010-12-23 23:26:43.515 Tutor02[5970:207] stat
2010-12-23 23:26:43.517 Tutor02[5970:207] open
2010-12-23 23:26:43.518 Tutor02[5970:207] fcntl
2010-12-23 23:26:43.518 Tutor02[5970:207] fstat
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
pwrite$UNIX2003 called from function hb_fsWriteAt in image Tutor02.
If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first.


Parece que aun nos faltan funciones del simulador . Estos errores solo salen en el simulador en el iphone funcionaria sin ningun problema .
Una forma de solucionarlo es con el sdk 4.1 del simulador ... el tema es que no sé un enlace para poder bajarlo ( yo lo tengo de antes )


----------- edito ------------------------
enlace para el sdk 4.1 (no instalar el xcode , solo extraer el sdk )
http://developer.apple.com/ios/download ... dk_4.1.dmg
Last edited by mastintin on Thu Dec 23, 2010 11:05 pm, edited 1 time in total.
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Postby mastintin » Thu Dec 23, 2010 10:54 pm

pgfdz wrote:Si puedes incluir como poner una imagen en UIImageView (creo que se llama) desde el Interface Builder, pues bien


Tienes 2 opciones :
colocar el imageview sin la imagen en el nib y luego llamarla desde codigo o incluir su llamada desde el nib ...
la primera seria asi :

Code: Select all  Expand view

local oView:=tView():resources(ownd,"Hola")
local cimage:= "tab_setting.png"
local oimg:=tImage():resources(oView,33,cImage)
 

la segunda escoje el nombre de la imagen desde el despelgable image del interface builder y omite el parametro cimage.
Saludos.
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Postby Antonio Linares » Fri Dec 24, 2010 12:04 am

Manuel,

La idea que estoy desarrollando es la siguiente:

1. Crear una aplicación "view based" y respetar el código que genera el xcode, con lo que se lanzará la ventana principal con el view que se haya diseñado en el interface builder. main.m no se modifica, es decir usa el código del xcode.

2. En didFinishLaunchingWithOptions añadir esto:
Code: Select all  Expand view

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
   
    // Override point for customization after application launch.
    SetWndMain( self.window );
   
    // Add the view controller's view to the window and display.
    [self.window addSubview:viewController.view];
    [self.window makeKeyAndVisible];
   
    hb_vmInit( TRUE );

    return YES;
}
 


3. hb_vmInit() ejecuta Main automaticamente y desde ahi recuperamos el handle de la ventana principal:
Code: Select all  Expand view

function Main()

   local oWnd := TWindow()
   
   oWnd:hWnd = GetWndMain()
   MsgInfo( oWnd:hWnd )
   
return nil    
 


4. Ahora se trata de cambiar el delegate de la aplicación por uno nuestro que nos rute los eventos.

Como ves es similar a lo que teniamos, pero respetando mucho más el propio diseño del xcode.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41205
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: he conseguido un iphone

Postby Antonio Linares » Fri Dec 24, 2010 7:51 am

En window.prg se detecta si hay handle de ventana principal y entonces no se crea pool de memoria ni aplicación:

Code: Select all  Expand view

procedure BuildPoolApp( lCreatePoolApp )

   static lInit := .F.

   DEFAULT lCreatePoolApp := .T.
   
    if ! lInit
        lInit = .T.
        if lCreatePoolApp
           CreatePool()
        endif  
        ErrorBlock( { | o | ShowError( o ) } )
        if lCreatePoolApp
           CreateApp()
        endif  
    endif
   
return         
     
init procedure OnStart

   BuildPoolApp( GetWndMain() == 0 )
   
return
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41205
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: he conseguido un iphone

Postby mastintin » Fri Dec 24, 2010 7:59 am

Antonio meter en delegate los eventos no sería ( aparentemente) demasiado complicado cambiando un poco la plantilla para que los genere automaticamente en cada proyecto . La pega que le veo es que perdemos algo de control del código al depender de una plantilla y no de una librería ( no se si se me entiende ) ...
------------------ edito ................................

Otra cosa mas .... nos falta la funcion pwrite$UNIX2003 en el archivo de compatibilidad ( error reportado por pgfdz )
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Postby Antonio Linares » Fri Dec 24, 2010 9:21 am

Manuel,

De momento he llegado a asignar el rootViewController de la ventana principal, la pega es que si pongo controles en el view en el interface builder no parecen responder. A ver si descubrimos que pasa:
Code: Select all  Expand view

@interface FPViewController : UIViewController
{
}
- ( void ) touchesBegan : ( NSSet * ) touches withEvent : ( UIEvent * ) event;
@end

@implementation FPViewController

- ( void ) touchesBegan : ( NSSet * ) touches withEvent : ( UIEvent * ) event
{
    NSLog( @"touchesBegan" );
}

@end

HB_FUNC( WNDSETCONTROLLER )
{
    UIWindow * window = ( UIWindow * ) hb_parnl( 1 );  
    FPViewController * vc = [ [ FPViewController alloc ] init ];
   
    window.rootViewController = vc;
}
 

La ventaja de este modelo es que no tenemos que derivar una clase de UIWindow y podemos trabajar con objetos UIWindow directamente :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41205
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: he conseguido un iphone

Postby Antonio Linares » Fri Dec 24, 2010 9:26 am

Otra cosa mas .... nos falta la funcion pwrite$UNIX2003 en el archivo de compatibilidad ( error reportado por pgfdz )


Implementada y subida al repositorio :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41205
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: he conseguido un iphone

Postby mastintin » Fri Dec 24, 2010 10:36 am

antonio , no lo he comprobado pues no estoy en el mac , pero me parece que falta por asignar el view que mouestra el controlador ....
Me explico un poco mejor :
Con
Code: Select all  Expand view

window.rootViewController = vc;    
 

Asignamos el controlador a la ventana principal y este se encarga de mostrar "su " view .
Para asignar el view o bien lo asignamos con la propiedad view o al crear el controlador con initWithNibName:bundle:
¿ será que no hemos asignado un view al controlador ?
Un Saludo.
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: he conseguido un iphone

Postby mastintin » Fri Dec 24, 2010 3:43 pm

pgfdz wrote:
mastintin wrote:
pgfdz wrote:DBUSEAREA( .t., ,AppPath()+ "/ruta.dbf" , "rutas")
ERROR

[Session started at 2010-12-23 19:50:45 +0100.]
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
stat$INODE64 called from function s_fileExtOpen in image Tutor02.
If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first.

Te envio la nueva librería que en teoría ya resuelve el problema . Cambiala y miramos a ver si funciona...
http://rapidshare.com/files/438930423/libfivephone.a
Saludos.


Se queda colgado y pone en la consola todo el rato:

2010-12-23 23:17:45.929 Tutor02[5874:207] stat
2010-12-23 23:17:45.930 Tutor02[5874:207] open
2010-12-23 23:17:45.931 Tutor02[5874:207] stat
2010-12-23 23:17:45.931 Tutor02[5874:207] open

Ahora he hecho el create en el apppath y luego el use y me sale:


[Session started at 2010-12-23 23:26:42 +0100.]
2010-12-23 23:26:43.515 Tutor02[5970:207] stat
2010-12-23 23:26:43.517 Tutor02[5970:207] open
2010-12-23 23:26:43.518 Tutor02[5970:207] fcntl
2010-12-23 23:26:43.518 Tutor02[5970:207] fstat
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
pwrite$UNIX2003 called from function hb_fsWriteAt in image Tutor02.
If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first.



Nueva libreria con la funcion añadida .... http://rapidshare.com/files/439055213/libfivephone.a
Cambiala y vemos si falta algo mas .
Saludos.
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

PreviousNext

Return to FiveMac / FivePhone (iPhone, iPad)

Who is online

Users browsing this forum: No registered users and 4 guests