Search Results

Search found 261 results on 11 pages for 'mohammad ashraful alam'.

Page 10/11 | < Previous Page | 6 7 8 9 10 11  | Next Page >

  • Loading an external NIB, how do I set the view property?

    - by Sheehan Alam
    If I am loading a view from another NIB, how do I set the File's Owner view property? IB is not letting me hook it up to my View Controller which is loading the external NIB. My NIB looks like this: File's Owner - Identity is set to LBRootViewController First Responder LBTableViewController - Identity is set to LBTableViewController, NIB Name is LBTableViewController

    Read the article

  • UITableView does not scroll to cell

    - by Sheehan Alam
    I am trying to scroll my tableview to the 2nd cell: [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:0] atScrollPosition:UITableViewScrollPositionNone animated:NO]; I get the error: *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[UITableView scrollToRowAtIndexPath:atScrollPosition:animated:]: section (1) beyond bounds (0). ' My tableview has 30 cells that are appearing with no sections.

    Read the article

  • What is the proper way of hard-coding sections in a UITableView?

    - by Sheehan Alam
    I have a UITableView with 3 sections that are hard coded. Everything is working fine, but I am not sure if I am doing it correctly. Define number of rows in section: - (NSInteger)tableView:(UITableView *)tblView numberOfRowsInSection:(NSInteger)section { NSInteger rows; //Bio Section if(section == 0){ rows = 2; } //Profile section else if(section == 1){ rows = 5; } //Count section else if(section == 2){ rows = 3; } } return rows; } Here is where I build my cells: - (UITableViewCell *)tableView:(UITableView *)tblView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tblView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; } cell.textLabel.numberOfLines = 5; cell.textLabel.font = [UIFont fontWithName:@"Helvetica" size:(10.0)]; cell.textLabel.lineBreakMode = UILineBreakModeWordWrap; if ([self.message_source isEqualToString:@"default"]) { if (indexPath.section == 0) { if (indexPath.row == 0) { cell.textLabel.text = [Utils formatMessage:[NSString stringWithFormat: @"%@", mySTUser.bio]]; cell.detailTextLabel.text = nil; } else if(indexPath.row == 1){ cell.textLabel.text = [NSString stringWithFormat: @"%@", mySTUser.website]; cell.detailTextLabel.text = nil; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; } } } //more code exists, but you get the point... Now I define my number of sections - (NSInteger)numberOfSectionsInTableView:(UITableView *)tblView { return 3; } Is this the proper way of hard-coding my UITableView? Will I run into any issues when cells are reused?

    Read the article

  • How to check if a BOOL is null?

    - by Sheehan Alam
    Is there a way I can check to see if a value is NULL/Nil before assigning it to a BOOL? For example, I have a value in a NSDictionary that can be either TRUE/FALSE/NULL mySTUser.current_user_following = [[results objectForKey:@"current_user_following"]boolValue]; When the value is NULL I get the following error *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSNull boolValue]: unrecognized selector sent to instance I would like to be able to handle the NULL case.

    Read the article

  • [Facebook Graph API - Android] I want to know the HTTPSConnection redirected to which URL?

    - by Mohammad Abdelaziz
    I am building an application that uses the Facebook Graph API. To get the access token I should send the following request https://graph.facebook.com/oauth/authorize? client_id=...& redirect_uri=http://www.example.com/callback It redirects to the redirect_uri with the code to be used as access token. How can I capture that the HttpsURLConnection is redirected and how to get the code? Is it possible or I need to have server that gets the access token?

    Read the article

  • not work jquery for for input value

    - by Mohammad
    main code : var clone = div.clone(); clone.attr('id', sabad_kala_id); $('.content').append(clone); $('div#'+sabad_kala_id).replaceWith('<tr id='+sabad_kala_id+'><td width="50"><a class="del_kala" id='+sabad_kala_id+'><img src="images/delete.png" alt="delete" /></a></td><td width="50">1.</td><td width="388">'+title+'</td><td width="80" clas="mm"><input class="count" type="text" value='+count+' /></td><td width="100">'+price+' $</td><td width="120">'+price_count+' $</td></tr>'); and this code run perfect after append and replace , user can edit input.count in table and below code have run : ('input.count').keyup(function(e){ alert(test); }); but this code not work :(

    Read the article

  • UIImageView doesn't update with my image

    - by Sheehan Alam
    I am trying to set my image: detailedEventViewController.thumbnail.image = [UIImage imageNamed:@"amnesia.png"]; But the imageview appears blank. amnesia.png is in my resources group. The file exists. Results of my log: 2011-01-08 10:52:32.822 HD Pocket Vacations[25271:207] Image: <UIImage: 0x66203b0> 2011-01-08 10:52:32.823 HD Pocket Vacations[25271:207] dEVC: <DetailedEventViewController: 0x6628340> 2011-01-08 10:52:32.824 HD Pocket Vacations[25271:207] thumbnail: (null)

    Read the article

  • Change English numbers to Persian and vice versa in MVC (httpmodule)?

    - by Mohammad
    I wanna change all English numbers to Persian for showing to users. and change them to English numbers again for giving all requests (Postbacks) e.g: we have something like this in view IRQ170, I wanna show IRQ??? to users and give IRQ170 from users. I know, I have to use Httpmodule, But I don't know how ? Could you please guide me? Edit : Let me describe more : I've written the following http module : using System; using System.Collections.Specialized; using System.Diagnostics; using System.IO; using System.Text; using System.Text.RegularExpressions; using System.Web; using System.Web.UI; using Smartiz.Common; namespace Smartiz.UI.Classes { public class PersianNumberModule : IHttpModule { private StreamWatcher _watcher; #region Implementation of IHttpModule /// <summary> /// Initializes a module and prepares it to handle requests. /// </summary> /// <param name="context">An <see cref="T:System.Web.HttpApplication"/> that provides access to the methods, properties, and events common to all application objects within an ASP.NET application </param> public void Init(HttpApplication context) { context.BeginRequest += ContextBeginRequest; context.EndRequest += ContextEndRequest; } /// <summary> /// Disposes of the resources (other than memory) used by the module that implements <see cref="T:System.Web.IHttpModule"/>. /// </summary> public void Dispose() { } #endregion private void ContextBeginRequest(object sender, EventArgs e) { HttpApplication context = sender as HttpApplication; if (context == null) return; _watcher = new StreamWatcher(context.Response.Filter); context.Response.Filter = _watcher; } private void ContextEndRequest(object sender, EventArgs e) { HttpApplication context = sender as HttpApplication; if (context == null) return; _watcher = new StreamWatcher(context.Response.Filter); context.Response.Filter = _watcher; } } public class StreamWatcher : Stream { private readonly Stream _stream; private readonly MemoryStream _memoryStream = new MemoryStream(); public StreamWatcher(Stream stream) { _stream = stream; } public override void Flush() { _stream.Flush(); } public override int Read(byte[] buffer, int offset, int count) { int bytesRead = _stream.Read(buffer, offset, count); string orgContent = Encoding.UTF8.GetString(buffer, offset, bytesRead); string newContent = orgContent.ToEnglishNumber(); int newByteCountLength = Encoding.UTF8.GetByteCount(newContent); Encoding.UTF8.GetBytes(newContent, 0, Encoding.UTF8.GetByteCount(newContent), buffer, 0); return newByteCountLength; } public override void Write(byte[] buffer, int offset, int count) { string strBuffer = Encoding.UTF8.GetString(buffer, offset, count); MatchCollection htmlAttributes = Regex.Matches(strBuffer, @"(\S+)=[""']?((?:.(?![""']?\s+(?:\S+)=|[>""']))+.)[""']?", RegexOptions.IgnoreCase | RegexOptions.Multiline); foreach (Match match in htmlAttributes) { strBuffer = strBuffer.Replace(match.Value, match.Value.ToEnglishNumber()); } MatchCollection scripts = Regex.Matches(strBuffer, "<script[^>]*>(.*?)</script>", RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace); foreach (Match match in scripts) { MatchCollection values = Regex.Matches(match.Value, @"([""'])(?:(?=(\\?))\2.)*?\1", RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace); foreach (Match stringValue in values) { strBuffer = strBuffer.Replace(stringValue.Value, stringValue.Value.ToEnglishNumber()); } } MatchCollection styles = Regex.Matches(strBuffer, "<style[^>]*>(.*?)</style>", RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace); foreach (Match match in styles) { strBuffer = strBuffer.Replace(match.Value, match.Value.ToEnglishNumber()); } byte[] data = Encoding.UTF8.GetBytes(strBuffer); _memoryStream.Write(data, offset, count); _stream.Write(data, offset, count); } public override string ToString() { return Encoding.UTF8.GetString(_memoryStream.ToArray()); } #region Rest of the overrides public override bool CanRead { get { throw new NotImplementedException(); } } public override bool CanSeek { get { throw new NotImplementedException(); } } public override bool CanWrite { get { throw new NotImplementedException(); } } public override long Seek(long offset, SeekOrigin origin) { throw new NotImplementedException(); } public override void SetLength(long value) { throw new NotImplementedException(); } public override long Length { get { throw new NotImplementedException(); } } public override long Position { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } #endregion } } It works well, but It converts all numbers in css and scripts files to Persian and it causes error.

    Read the article

  • Display keyboard above toolbar?

    - by Sheehan Alam
    I have a view with a bottom toolbar and a UIWebview that is loading an HTML page with some textboxes. Is there anyway when the user clicks on a textbox, the keyboard appears above the toolbar, that way it doesn't hide its buttons?

    Read the article

  • Do properties need to be deallocated?

    - by Sheehan Alam
    I subclassed NSObject: #import <Foundation/Foundation.h> @interface STObject : NSObject { NSString *message_type; NSString *twitter_in_reply_to_screen_name; } @property(nonatomic, copy) NSString *message_type; @property(nonatomic, copy) NSString *twitter_in_reply_to_screen_name; @end My implementation looks like: #import "STObject.h" @implementation STObject @synthesize message_type, twitter_in_reply_to_screen_name; @end Do I need to create a dealloc method for my two properties where I release the strings?

    Read the article

  • Setting UITableViewCell height is expensive

    - by Sheehan Alam
    I am doing a comparison in - (CGFloat)tableView:(UITableView *)tblView heightForRowAtIndexPath:(NSIndexPath *)indexPath It seems like performance of my app really slows down when I check if a cell.detailTextLabel.text isEqualTo:@"None"; What is a better way of doing the comparison and setting the cell height?

    Read the article

  • How to show empty view when ListView is empty?

    - by Sheehan Alam
    Here is my layout. For some reason the empty view (TextView in this case) always appears, even when the List is not empty. I thought the ListView would automatically detect when to show the empty view. How can I hook up the empty view properly? <RelativeLayout android:id="@+id/LinearLayoutAR" android:layout_height="fill_parent" android:layout_width="fill_parent"> <ListView android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ARListView"></ListView> <ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/arProgressBar" android:layout_centerHorizontal="true" android:layout_centerVertical="true"></ProgressBar> <!-- Here is the view to show if the list is emtpy --> <TextView android:id="@id/android:empty" android:layout_width="match_parent" android:layout_height="match_parent" android:text="No Results" /> </RelativeLayout>

    Read the article

< Previous Page | 6 7 8 9 10 11  | Next Page >