Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > Mobile > Mobile Forum > IOS - IPAD Split view textfield ไม่อัพเดท แต่ส่งค่าจาก master ไป detail ปกติ



 

IOS - IPAD Split view textfield ไม่อัพเดท แต่ส่งค่าจาก master ไป detail ปกติ

 



Topic : 102262

Guest




ส่งค่าจาก Master ไป Detail ได้แล้ว แต่ไม่สามารถกดใน table cell master แล้วค่าเปลี่ยนใน textfield detail ได้



Tag : Mobile, iOS







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-11-01 13:49:00 By : NOMAC View : 858 Reply : 2
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Capture ภาพ พร้อม Code คร่าว ๆ มาดูหน่อยครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-11-01 17:33:13 By : mr.win
 


 

No. 2

Guest


UserDetailViewController.h

Code (Objective-C)
#import <UIKit/UIKit.h>
#import <sqlite3.h>

@interface UserDetailViewController : UIViewController<UISplitViewControllerDelegate>
{
    sqlite3 *database;

    IBOutlet UITextField *txtName;
    
}


@property (strong, nonatomic) id userid;

- (IBAction)BtnPriv;
@end


UserDetailViewController.m

Code (Objective-C)
#import "UserDetailViewController.h"

@interface UserDetailViewController ()

@end

@implementation UserDetailViewController
@synthesize userid;

NSString *uname;
NSString *pswd;
NSString *name;
NSString *utet;
NSString *uaddr;
NSString *umail;
NSString *upos;
NSString *urol;
NSString *uidset;


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}
- (void)setUserid :(id)newuserid
{
    if (userid != newuserid) {
        userid = newuserid;
        uidset = userid;
    }
    
    [self loadDataUserid];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    [self loadDataUserid];
    
}

- (void)loadDataUserid
{
    NSLog(@"ddd");
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *path = [documentsDirectory stringByAppendingPathComponent:@"testDB.sqlite"];
    
    const char *dbpath = [path UTF8String];
    
    if(sqlite3_open(dbpath,&database)!=SQLITE_OK)
    {
        NSLog(@"Not have DB");
        return;
    };
    
    const char *uid;
    if (self.userid) {
        uid = [uidset UTF8String];
    }else{
            uid = "125204";
    }
    NSLog(@"%s",uid);
    
    sqlite3_stmt *statement;
    sqlite3_prepare_v2(database, "SELECT * From allUser where user_id = ?", -1, &statement, nil);
    sqlite3_bind_text(statement, 1,uid, -1, SQLITE_TRANSIENT);

    while(sqlite3_step(statement) == SQLITE_ROW) {
        
        name  = [[NSString alloc] initWithUTF8String: (char *)sqlite3_column_text(statement, 3)];

    }

    txtName.text     = name;
    
    NSLog(@"%@",txtName);// เมื่อกดtable ใน master แล้วมีค่าเป็น Null????
    
    
    sqlite3_finalize(statement);
    sqlite3_close(database);

}


ShowUserViewController.h
Code (Objective-C)
#import <UIKit/UIKit.h>
#import <sqlite3.h>

@class UserDetailViewController;

@interface ShowUserViewController : UITableViewController
{
    
    NSString *name;
    NSString *userid;

}


@property (strong, nonatomic) UserDetailViewController *userdetailViewController;

@end


ShowUserViewController.m
Code (Objective-C)
#import "ShowUserViewController.h"
#import "UserDetailViewController.h"

@interface ShowUserViewController ()

@end

@implementation ShowUserViewController

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

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    name    = @"user_name";
    userid  = @"user_id";
    
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    [self loadDataComid];
    [self loadDataAllUServiaWebService];

}

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

#pragma mark - Table view data source

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.

        return Users.count;

}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]autorelease];
    }
    NSDictionary *tmpDict = Users[indexPath.row];
    
    cell.textLabel.text = [tmpDict objectForKey:name];

    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSDictionary *tmpDict         = Users[indexPath.row];
    UserDetailViewController *udv = [[UserDetailViewController alloc]init];
    [udv setUserid   :[tmpDict objectForKey:userid ]];
    
}

@end

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-11-02 09:39:25 By : NOMAC
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : IOS - IPAD Split view textfield ไม่อัพเดท แต่ส่งค่าจาก master ไป detail ปกติ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่