Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在iOS中切换视图时,SQlite更新不起作用_Ios_Database_Xcode_Sqlite - Fatal编程技术网

在iOS中切换视图时,SQlite更新不起作用

在iOS中切换视图时,SQlite更新不起作用,ios,database,xcode,sqlite,Ios,Database,Xcode,Sqlite,我有一个Favorites视图,它从sqlite数据库加载数据。很明显,它将进入细胞 Favorites视图类名为FavReal。我启用了CaneditRowatineXpath,其操作是从数据库中删除条目并将其从表视图中删除。很好用!我还有一个清除所有收藏夹按钮,可以正确删除所有条目 现在,如果我单击一个单元格,它会将我带到另一个名为Details22视图的视图。在这个视图中,我获得了所选单元格的详细信息,它可以正常工作 现在,单击条目并返回收藏夹视图后。如果我试图通过滑动手势或清除所有按钮删

我有一个Favorites视图,它从sqlite数据库加载数据。很明显,它将进入细胞

Favorites视图类名为FavReal。我启用了CaneditRowatineXpath,其操作是从数据库中删除条目并将其从表视图中删除。很好用!我还有一个清除所有收藏夹按钮,可以正确删除所有条目

现在,如果我单击一个单元格,它会将我带到另一个名为Details22视图的视图。在这个视图中,我获得了所选单元格的详细信息,它可以正常工作

现在,单击条目并返回收藏夹视图后。如果我试图通过滑动手势或清除所有按钮删除条目。它不起作用:没有错误没有什么它只是不会从数据库中删除它,只是会立即从表视图中删除它

这是我的密码

/*FavReal.m*/

//
//法夫雷尔
//AuthorsApp
//
//georges ouyoun于2012年8月16日创作。
//版权所有(c)2012年\uuuu MyCompanyName\uuuuu。版权所有。
//
#导入“FavReal.h”
#进口
#导入“Author.h”
#导入“Details22.h”
#导入“AuthorVC.h”
@接口FavReal()
@结束
@实现FavReal
@合成Label2;
@合成AFV;
@综合作者;
NSString*authorNAme;
NSString*authorNAme3,*authorNAme4;
NSString*authorFav;
NSString*PathDB;
-(id)initWithStyle:(UITableViewStyle)样式
{
self=[super initWithStyle:style];
如果(自我){
//自定义初始化
}
回归自我;
}
-(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
NSLog(@“输入cellForRowAtIndexPath”);
静态NSString*CellIdentifier2=@“FavoritesCell”;
UITableViewCell*cell2=[tableView dequeueReusableCellWithIdentifier:CellIdentifier2];
NSLog(@“在if之前中断”);
if(cell2==nil){
NSLog(@“输入了nil单元格1”);
cell2=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle重用标识符:CellIdentifier 2];
NSLog(@“输入了nil单元格2”);
}
Author*author8=[self.theFav objectAtIndex:indexath.row];
NSLog(@“作者已初始化”);
cell2.textlab.text=author8.title;
NSLog(@“这是author8.title变量%@”,author8.title);
NSLog(@“Cell2已初始化”);
//NSString*cellName=cell2.textlab.text;
//[theFav发布];
返回单元格2;
}
-(无效)视图将显示:(BOOL)动画{
//[self.tableView单元格];
NSLog(@“§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§;
[自编作者2];
[self.tableView重载数据];
NSLog(@“§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§;
[自视下载];
}
-(无效)viewDidLoad
{
NSLog(@“§§§§§§§§§§§§§§§§§§§§§§§§”);
UIBarButtonItem*nextButton=[[UIBarButtonItem alloc]
initWithTitle:@“清除所有收藏夹”
样式:UIBarButtonimStyleBordered
目标:自我
动作:@selector(deleteSomeStuff)];
[[self-navigationItem]setLeftBarButtonItem:nextButton];
[nextButton release],nextButton=nil;
[自编作者2];
[超级视图下载];
}
-(无效)视图卸载
{
NSLog(@“§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§“);
[自设标签2:nil];
[ClearBu发布];
ClearBu=零;
[超级视频下载];
}
-(无效)视图将消失:(BOOL)已设置动画{
}
-(布尔)应自动旋转指针面定向:(UIInterfaceOrientation)interfaceOrientation
{
返回(interfaceOrientation==UIInterfaceOrientationGraphic);
}
#pragma标记-表视图数据源
-(NSInteger)表格视图中的节数:(UITableView*)表格视图
{
#警告:方法实现可能不完整。
//返回节数。
返回1;
}
-(NSInteger)表视图:(UITableView*)表视图行数节:(NSInteger)节
{
#警告:方法实现不完整。
整数行数;
rowCount=offav.count;
返回行计数;
}
-(NSMutableArray*)authorList2{
NSFileManager*fileManager=[NSFileManager defaultManager];
NSLog(@“1”);
theFav=[[NSMutableArray alloc]initWithCapacity:1000000];
@试一试{
NSLog(@“1α:”);
BOOL success=[fileManager fileExistsAtPath:PathDB];
NSLog(@“1伽马”);
如果(!成功)
{
NSLog(@“2”);
NSLog(@“找不到数据库文件“%@.”,路径数据库);
}
NSLog(“成功”);
如果(!(sqlite3_打开([PathDB UTF8String],&db2)==SQLITE_确定))
{
NSLog(@“3”);
NSLog(@“发生错误:%@”,sqlite3_errmsg(db2));
}
NSLog(@“数据库已打开”);
//const char*sql=“从words中选择F_关键字”;
const char*sql2=“从Fav中选择名称”;
sqlite3_stmt*sqlStatement2;
if(sqlite3\u prepare(db2,sql2,-1,&sqlStatement2,NULL)!=SQLITE\u OK)
{
NSLog(@“prepare语句有问题:%@”,sqlite3_errmsg(db2));
}否则{
while(sqlite3_步骤(sqlStatement2)==SQLITE_行){
//NSLog(@“问题不在于查询,而在于这里!!”;
Author*author2=[[Author alloc]init];
//author2.fav=[NSString stringWithUTF8String:(char*)sqlite3\u column\u text(sqlStatement2,2)];
author2.title=[NSString stringWithUTF8String:(char*)sqlite3_column_text(sqlStatement2,0)];
//authorFav=author2.title;
[theFav addObject:author2];
}
}
}
@捕获(NSException*异常){
NSLog(@“prepare语句有问题:%@”,sqlite3_errmsg(db2));
}
@最后{
返回AFV;
}
}
-(空)删除某物{
//
//  FavReal.m
//  AuthorsApp
//
//  Created by georges ouyoun on 8/16/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "FavReal.h"
#import <sqlite3.h>
#import "Author.h" 
#import "Details22.h"
#import "AuthorVC.h"
@interface FavReal ()

@end

@implementation FavReal
@synthesize textLabel2;
@synthesize theFav;
@synthesize author; 
NSString *authorNAme;
NSString *authorNAme3 , *authorNAme4;
NSString *authorFav;
NSString *PathDB;

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

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"entered the cellForRowAtIndexPath");
    static NSString *CellIdentifier2 = @"FavoritesCell";

    UITableViewCell *cell2 = [tableView dequeueReusableCellWithIdentifier:CellIdentifier2];
            NSLog(@"Break before the if");
    if (cell2 == nil) {
        NSLog(@"Entered the nil cell 1 ");
        cell2= [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier2];
        NSLog(@"Entered the nil cell 2 ");
    }

    Author *author8 = [self.theFav objectAtIndex:indexPath.row];
    NSLog(@"Author initialized");
    cell2.textLabel.text = author8.title;
    NSLog(@"This is the author8.title variable %@" , author8.title);
    NSLog(@"Cell2 is initialized");
 //   NSString *cellName = cell2.textLabel.text;

 //   [theFav release];
        return cell2;

}

-(void)viewWillAppear:(BOOL)animated{
//    [self.tableView cell];
    NSLog(@"§§§§§§§§§§§§§ VIew will appear phase 1 §§§§§§§§§§§§§§§§");

    [self authorList2];
    [self.tableView reloadData] ;
    NSLog(@"§§§§§§§§§§§§§ VIew will appear §§§§§§§§§§§§§§§§");
   [self viewDidLoad];
}

- (void)viewDidLoad
{
      NSLog(@"§§§§§§§§§§§§§ ViewDidLoad §§§§§§§§§§§§§§§§");
    UIBarButtonItem *nextButton = [[UIBarButtonItem alloc]
                                   initWithTitle:@"Clear All Favorites"
                                   style:UIBarButtonItemStyleBordered

                                   target:self
                                   action:@selector(deleteSomeStuff)];

    [[self navigationItem] setLeftBarButtonItem:nextButton];

    [nextButton release], nextButton = nil;

    [self authorList2];
    [super viewDidLoad];

}

- (void)viewDidUnload
{

    NSLog(@"§§§§§§§§§§§§§ ViewDid UN-Load §§§§§§§§§§§§§§§§");

    [self setTextLabel2:nil];
    [ClearBu release];
    ClearBu = nil;
    [super viewDidUnload];

}

-(void) viewWillDisappear:(BOOL)animated{

}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
#warning Potentially incomplete method implementation.
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
#warning Incomplete method implementation.
    int rowCount;

     rowCount = theFav.count;
    return rowCount;
}

-(NSMutableArray *) authorList2{

    NSFileManager *fileManager = [NSFileManager defaultManager];

    NSLog(@"1");
    theFav = [[NSMutableArray alloc] initWithCapacity:1000000];

    @try {
        NSLog(@"1 alpha:");

        BOOL success = [fileManager fileExistsAtPath:PathDB];
        NSLog(@"1 gamma");
        if(!success)
        {
            NSLog(@"2");
            NSLog(@"Cannot locate database file '%@'.", PathDB);
        }
        NSLog(@"Success");
        if(!(sqlite3_open([PathDB UTF8String], &db2) == SQLITE_OK))
        {
            NSLog(@"3");
            NSLog(@"An error has occured: %@", sqlite3_errmsg(db2));

        }

        NSLog(@"Database opened");
        // const char *sql = "SELECT F_Keyword FROM wordss";  
        const char *sql2 = "SELECT Name FROM Fav";

        sqlite3_stmt *sqlStatement2;
        if(sqlite3_prepare(db2, sql2, -1, &sqlStatement2, NULL) != SQLITE_OK)
        {
            NSLog(@"Problem with prepare statement:  %@", sqlite3_errmsg(db2));
        }else{
            while (sqlite3_step(sqlStatement2)==SQLITE_ROW) {
              //  NSLog(@"Probleme not with the query but in here!!");
                Author * author2 = [[Author alloc] init];
                //author2.fav = [NSString stringWithUTF8String:(char *) sqlite3_column_text(sqlStatement2,2)];
                author2.title = [NSString stringWithUTF8String:(char *) sqlite3_column_text(sqlStatement2,0)];

               // authorFav=author2.title;              
                [theFav addObject:author2];

            }
        }
    }
    @catch (NSException *exception) {
        NSLog(@"Problem with prepare statement:  %@", sqlite3_errmsg(db2));
    }
    @finally {

        return theFav;
    }
}


-(void)deleteSomeStuff{
    NSLog(@"Delete Button Clicked");
    @try {
     //   NSLog(@"This is the authorName2 variable %@",authorNAme2);

        sqlite3_stmt *compiled_statement1;

        if(sqlite3_open([PathDB UTF8String], &db2) == SQLITE_OK) {

            NSString *formatedSql = [NSString stringWithFormat:@"DELETE FROM Fav"];

            const char *sql = [formatedSql UTF8String];
            NSLog(@" !!!!!!!! In the middle of it !!!!!!!!!!!!");
            if (sqlite3_prepare_v2(db2, sql, -1, &compiled_statement1, NULL) != SQLITE_OK) {
                NSLog(@"!!!!!!!!!!!!!!!!!!!ERRRRROOOOOOORRRRRRRRR!!!!!!!!!!!!!!!!!!!!!!!!!");

            }

            NSLog(@"This is the query %@",formatedSql);


            int success = sqlite3_step(compiled_statement1);

            if (success != SQLITE_ERROR) {
                NSLog(@"Successfully Deleted!");
                sqlite3_last_insert_rowid(db2);
            }

            if(sqlite3_prepare(db2, sql, -1, &compiled_statement1, NULL) != SQLITE_OK)
            {
                NSLog(@"Problem with prepare statement:  %@", sqlite3_errmsg(db2));

            }else{

                NSLog(@"Got in the else tag where pictures should change ");

                while (sqlite3_step(compiled_statement1)!=SQLITE_OK) {

                    NSLog(@"Got in the while tag");
                    break;
                    }
                }
            }

       // NSArray *arr;
        [self.theFav removeAllObjects]; 
        [self.tableView reloadData];

        }

    @catch (NSException *exception) {

        NSLog(@"Problem with prepare statement:  %@", sqlite3_errmsg(db2));
    }
    @finally {
        sqlite3_close(db2);
    }

}

/*
// 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

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    return YES;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if(editingStyle == UITableViewCellEditingStyleDelete)
    {
        @try{
            if(!(sqlite3_open([PathDB UTF8String], &db2) == SQLITE_OK))
            {
                NSLog(@"3");
               // NSLog(@"Could not open Db2", sqlite3_errmsg(db2));

            }
            else {
                NSLog(@"Db2 is opened");
            }
            NSIndexPath *indPath7= [NSIndexPath indexPathForRow:indexPath.row inSection:0]; 
            UITableViewCell *cell7 = [tableView cellForRowAtIndexPath:indPath7]; 
            NSString *cellText7 = cell7.textLabel.text;

          //  NSLog(@"§§§§§§§§§§§§§§§§§ This is the cell text §§§§§§§§§§" , cellText3);
            sqlite3_stmt *sqlStatement7;
            NSString *titleString = [[[NSString alloc] initWithFormat:@"%d",indexPath.row] autorelease];

            //const char *sql3 = ["DELETE FROM Fav WHERE rowid = '%@'" , titleString]  ;

            NSString *formatedSql3 = [NSString stringWithFormat:@"DELETE FROM Fav WHERE Name = '%@'" ,cellText7];
           // const char *formatedSql3 = [@"DELETE FROM Fav WHERE rowid = '%@'",titleString];

            NSLog(@"This is the DELETE Query %@", formatedSql3);
            const char *sql3 = [formatedSql3 UTF8String];
            NSLog(@"This is the titleString Variable %@ " , titleString);

            if(sqlite3_prepare(db2, sql3, -1, &sqlStatement7, NULL) != SQLITE_OK)
        {
            NSLog(@"Problem with prepare statement:  %@", sqlite3_errmsg(db2));
        }
            else{

                int successS = sqlite3_step(sqlStatement7);
                if (successS != SQLITE_DONE) {
                    NSLog(@"An error Has occured during the delete of the specific record");
                }
                else{

                    NSLog(@"Update Database successfull!");
                }
            }
        }    
                @catch (NSException *exception) {
                    NSLog(@"Problem with prepare statement:  %@", sqlite3_errmsg(db2));
                }

                @finally {
                    //sqlite3_finalize(sql);
                  //  sqlite3_close(db2);
                    //return theFav;
                }
            [self.theFav removeObjectAtIndex:indexPath.row];
            [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];

    }
}

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

    NSIndexPath *indPath3 = [NSIndexPath indexPathForRow:indexPath.row inSection:0]; 
    UITableViewCell *cell3 = [tableView cellForRowAtIndexPath:indPath3]; 
    NSString *cellText3 = cell3.textLabel.text;

  //  NSLog(@"This is at first : %@" , authorNAme);
  //   NSString *titleString2 = [[[NSString alloc] initWithFormat:@"Element row number :  %d",indexPath.row] autorelease];
    NSLog(@"This is the showDetailsForIndexPath");

    Details22 * vc4 = [self.storyboard instantiateViewControllerWithIdentifier:@"Details22"];
    //FavReal* author;
    NSLog(@"This is the showDetailsForIndexPath 2");

    @try{
            if(sqlite3_open([PathDB UTF8String], &db2) == SQLITE_OK) {

        NSString *titleString3 = [[[NSString alloc] initWithFormat:@"Element row number :  %d",indexPath.row] autorelease];
        NSLog(@"This is the row number chosen %@",titleString3);

       NSString *formatedSql333 = [NSString stringWithFormat:@"Select * from Sheet1 where field3 = '%@'" , cellText3 ];
                const char *formatedSql3333 = [formatedSql333 UTF8String];

        NSLog(@"This is the SQLite Approriate Query %@",formatedSql333);

        sqlite3_stmt *sqlStatement3;

        NSString *SearchedItem = cellText3;
        NSLog(@"This is the SearchedITem Variable %@" , SearchedItem);

        if(sqlite3_prepare(db2, formatedSql3333, -1, &sqlStatement3, NULL) != SQLITE_OK)
    {
            NSLog(@"Problem with prepare statement:  %@", sqlite3_errmsg(db2));
    }else{

     while (sqlite3_step(sqlStatement3)!=SQLITE_ERROR) {

         NSLog(@"Entered the While tag");   
         NSString *SearchedItem = cellText3;
         NSLog(@"This is the SearchedITem Variable %@" , SearchedItem);


                Author * author3 = [[Author alloc] init];
         NSLog(@" Debug 1  ");

                author3.name = [NSString stringWithUTF8String:(char *) sqlite3_column_text(sqlStatement3,2)];
                  NSLog(@" Debug 2  ");

                NSLog(@"This is the author.name in the FavReal %@" , author3.name);

                author3.title = [NSString stringWithUTF8String:(char *) sqlite3_column_text(sqlStatement3,3)];
         NSLog(@"This is the author.TITLE in the FavReal %@" , author3.title);

                author3.genre = [NSString stringWithUTF8String:(char *) sqlite3_column_text(sqlStatement3, 6)];
         NSLog(@"This is the author.GENRE in the FavReal %@" , author3.genre);
         NSLog(@"This is the authorName before %@", authorNAme);
         NSLog(@"This is the authorName2 before %@", authorNAme2);
         authorNAme = author3.genre;
         authorNAme2 = author3.name;

         NSLog(@"This is the authorName after %@", authorNAme);
         NSLog(@"This is the authorName2 after %@", authorNAme2);

         NSLog(@"Before the break");
         NSLog(@"Before the animation part");
         [self.navigationController pushViewController:vc4 animated:true];   
         NSLog(@"Passed the should animate part");

         break;
         NSLog(@"After the break");
     }     
               }
    }
    }

    @catch (NSException *exception) {
        NSLog(@"Problem with prepare statement:  %@", sqlite3_errmsg(db2));
    }
    @finally {
        sqlite3_close(db2);
        NSLog(@"The database should NOT be closed here");
    }
}

- (UITableViewCellAccessoryType)tableView:(UITableView *)tableView accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath {

    //return UITableViewCellAccessoryDetailDisclosureButton;
    return UITableViewCellAccessoryDisclosureIndicator;
}

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

    [self tableView:tableView didSelectRowAtIndexPath:indexPath];
}

- (void)dealloc {
    [theFav release];
    [self release];
    [textLabel2 release];
    [textLabel2 release];
    [ClearBu release];
    [super dealloc];
}
- (IBAction)ClearButtonAction:(id)sender {

    NSLog(@"Clear Button is Clicked");
}
@end
//
//  Details.m
//  AuthorsApp
//
//  Created by georges ouyoun on 7/17/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "AppDelegate.h"
#import "Details22.h"
#import "Author.h"
#import "AuthorVC.h"
#import <sqlite3.h>
#import "FavReal.h"
//#import "MTPopupWindow.h"


@interface Details22 ()

@end

@implementation Details22
//@synthesize Favo;
@synthesize text2;
@synthesize WebV2;
@synthesize labelText;
@synthesize selectedAuthors;
@synthesize author , infoRequest;
NSUInteger textFontSize2 = 20;
NSString *PathDB; 
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    NSLog(@"In the viewDidLoad this is the current value of the textFontSize %d" , textFontSize2);

    NSString * htmlString = [NSString stringWithFormat:@"\
                             <html>\
                             <body>\
                             <p dir='rtl' style = 'font-size:40px;'> %@ </p>\
                             </body>\
                             </html>",authorNAme];


    [self.WebV2 setScalesPageToFit:YES];
    [self.WebV2 loadHTMLString:htmlString baseURL:nil];

    self.text2.text = authorNAme2;

    /* ////////////////////////////////////////////         This is where the label text APPearsssssssss       ///////////////////////////          */

    NSLog(@"Everything is ok now !");

}
- (void)viewDidUnload
{
    //  [self setLabelText:nil];
    NSLog(@"U have entered view did unload in Details22");

    //[FavReal initialize];

    [self setText2:nil];

    [self setWebV2:nil];

    [sizeFontFromStepper release];
    sizeFontFromStepper = nil;
    [super viewDidUnload];

    //[self setLabelText:Nil];
    //[AuthorVC load];

    //[self release];
   // NSLog(@" FAvReal should have been initialised ");
    // Release any retained subviews of the main view.
}

-(void)viewWillAppear:(BOOL)animated
{ 
    NSLog(@"U have entered the viewWillAppear tag");
}

-(void) viewWillDisappear:(BOOL)animated{

      NSLog(@"This is the view will disappear tag in Details22");

}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return YES;
}

- (void)dealloc {
    [labelText release];

    [text2 release];
   // [fontStep release];
    [WebV2 release];
    [sizeFontFromStepper release];
   // [sizeFontFromStepper release];
    [super dealloc];
}

-(void)loadHTMLString:(int)textFontSize2
{
    NSString * htmlString = [NSString stringWithFormat:@"\
                             <html>\
                             <body>\
                             <p dir='rtl' style = 'font-size:%dpx;'> %@ </p>\
                             </body>\
                             </html>",textFontSize2,authorNAme];

    NSLog(@"This is the loadHTMLString function with a textFonSize of %d" , textFontSize2);

    //[self.WebV setScalesPageToFit:YES];
    [self.WebV2 loadHTMLString:htmlString baseURL:nil];

}
- (IBAction)loadHtmlNewFontSize:(int)textFontSize2 {

    textFontSize2 = sizeFontFromStepper.value;

    [self loadHTMLString:textFontSize2];

    NSLog(@"This is textFontSize %d" , textFontSize2);
}          

@end