Search Results

Search found 4 results on 1 pages for 'jeena'.

Page 1/1 | 1 

  • UISearchDisplayController "shouldReloadTableForSearchString return NO" reloads table

    - by Jeena
    Why does my UISearchDisplayController show "No results" even if the shouldReloadTableForSearchString method returns NO? Shouldn't it just do nothing and stay black? How can I prevent it from doing so? #import "RootViewController.h" #pragma mark Table view methods - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } // Customize the number of rows in the table view. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if (tableView == self.searchDisplayController.searchResultsTableView) { return 0; } return 10; } // Customize the appearance of table view cells. - (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]; } // Configure the cell. cell.textLabel.text = [NSString stringWithFormat:@"row %d", indexPath.row]; return cell; } #pragma mark SearchController stuff - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString { return NO; } - (void)dealloc { [super dealloc]; } @end

    Read the article

  • Params order in Foo.new(params[:foo]), need one before the other (Rails)

    - by Jeena
    I have a problem which I don't know how to fix. It has to do with the unsorted params hash. I have a object Reservation which has a virtual time= attribute and a virtual eating_session= attribute when I set the time= I also want to validate it via an external server request. I do that with help of the method times() which makes a lookup on a other server and saves all possible times in the @times variable. The problem now is that the method times() needs the eating_session attribute to find out which times are valid, but rails sometimes calls the times= method first, before there is any eating_session in the Reservation object when I just do @reservation = Reservation.new(params[:reservation]) class ReservationsController < ApplicationController def new @reservation = Reservation.new(params[:reservation]) # ... end end class Reservation < ActiveRecord::Base include SoapClient attr_accessor :date, :time belongs_to :eating_session def time=(time) @time = times.find { |t| t[:time] == time } end def times return @times if defined? @times @times = [] response = call_soap :search_availability { # eating_session is sometimes nil :session_id => eating_session.code, # <- HERE IS THE PROBLEM :dining_date => date } response[:result].each do |result| @times << { :time => "#{DateTime.parse(result[:time]).strftime("%H:%M")}", :correlation_data => result[:correlation_data] } end @times end end I have no idea how to fix this, any help is apriciated.

    Read the article

  • focus a NSTextField

    - by Jeena
    I have a NSTextField and I want to set its content if I klick on a button and than set the cursor on this textfield at the end of the text so if someone klicks the button he could just begin to type. Until now I use [NSTextField selectText] it selects this textfield but it selects the whole text so if someone just begins to type he'd lose all the text which alread is in the textfield.

    Read the article

  • How to use NSWindowDidExposeNotification

    - by Jeena
    Hi, I am trying to update another windows when the one becomes visible. So I found the NSWindowDidExposeNotification and tried to work with it, so I wrote in my awakeFromNib: // MyClass.m - (void)awakeFromNib { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc addObserver:self selector:@selector(mentionsWindowDidExpose:) name:NSWindowDidExposeNotification object:nil]; } and implemented the method // MyClass.h - (void)mentionsWindowDidExpose:(id)sender; // MyClass.m - (void)mentionsWindowDidExpose:(id)sender { NSLog(@"test"); } But it never gets called which is odd. What do I do wrong here?

    Read the article

1